]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/cnid.c
afp_ldap.conf is gone
[netatalk.git] / libatalk / util / cnid.c
index 8870224aee5d6cb47a1623fdc5403711e2c9ef8b..375309071d57bce7f5fd5317a69231069d343d52 100644 (file)
@@ -119,7 +119,11 @@ bstring rel_path_in_vol(const char *path, const char *volpath)
      *   volpath: /Volume/netatalk/
      * we want: "dir/bla"
      */
-    EC_ZERO(bdelete(fpath, 0, strlen(volpath)));
+    int len = strlen(volpath);
+    if (volpath[len-1] != '/')
+        /* in case volpath has no trailing slash */
+        len ++;
+    EC_ZERO(bdelete(fpath, 0, len));
 
 EC_CLEANUP:
     if (dname) free(dname);