]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/cnid.c
Merge branch 'release-3.0.6'
[netatalk.git] / libatalk / util / cnid.c
index 8870224aee5d6cb47a1623fdc5403711e2c9ef8b..0cc56d49514ea4ae5ba454a009c4bdf3e5620948 100644 (file)
@@ -48,7 +48,6 @@
 
 #include <atalk/util.h>
 #include <atalk/cnid.h>
-#include <atalk/volinfo.h>
 #include <atalk/bstrlib.h>
 #include <atalk/bstradd.h>
 #include <atalk/logger.h>
@@ -119,7 +118,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);