Commit 06b53479 authored by Mark Adler's avatar Mark Adler

Fix bug in directory traversal.

This off-by-one error resulted in useless reexamination of the
same files by descending twice into each directory.
parent 1a4c4041
......@@ -3542,7 +3542,7 @@ local void process(char *path)
/* run process() for each entry in the directory */
base = len && g.inf[len - 1] != (unsigned char)'/' ?
vstrcpy(&g.inf, &g.inz, len, "/") : len;
vstrcpy(&g.inf, &g.inz, len, "/") - 1 : len;
for (off = 0; roll[off]; off += strlen(roll + off) + 1) {
vstrcpy(&g.inf, &g.inz, base, roll + off);
process(g.inf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment