struct bstrList *l = NULL;
struct stat st;
- *did = htonl(1);
cnid = htonl(2);
EC_NULL(rpath = rel_path_in_vol(path, vol->volinfo.v_path));
EC_NULL(statpath = bfromcstr(vol->volinfo.v_path));
+ EC_ZERO(bcatcstr(statpath, "/"));
l = bsplit(rpath, '/');
for (int i = 0; i < l->qty ; i++) {
*did = cnid;
+
EC_ZERO(bconcat(statpath, l->entry[i]));
EC_ZERO_LOGSTR(lstat(cfrombstr(statpath), &st),
"lstat(rpath: %s, elem: %s): %s: %s",
* 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);