summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6a4287f)
you tell agedu to scan, it will store that slash in the index and
confuse parts of the rest of the code. Strip such slashes off before
beginning the scan.
git-svn-id: svn://svn.tartarus.org/sgt/agedu@9416
cda61777-01e9-0310-a592-
d414129be87e
size_t pathlen, pathsize;
pathlen = strlen(inpath);
size_t pathlen, pathsize;
pathlen = strlen(inpath);
+
+ /*
+ * Trim any trailing slashes from the input path, otherwise we'll
+ * store them in the index with confusing effects.
+ */
+ while (pathlen > 1 && inpath[pathlen-1] == '/')
+ pathlen--;
+
pathsize = pathlen + 256;
path = snewn(pathsize, char);
pathsize = pathlen + 256;
path = snewn(pathsize, char);
+ memcpy(path, inpath, pathlen);
+ path[pathlen] = '\0';
du_recurse(&path, pathlen, &pathsize, gotdata, err, gotdata_ctx, 1);
}
du_recurse(&path, pathlen, &pathsize, gotdata, err, gotdata_ctx, 1);
}