diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2016-11-21 14:20:29 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2016-11-21 14:20:29 -0500 |
commit | cd09f52da8596295841cb832d84f0e728bff449d (patch) | |
tree | 83823509a3fe543f3000e1fe002f1538d0d682c0 /eval.c | |
parent | 059e23e9227d300c1608262808c5f4043abe50f1 (diff) | |
download | bfs-cd09f52da8596295841cb832d84f0e728bff449d.tar.xz |
Fix -execdir for root paths with no slashes.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -388,7 +388,11 @@ static void exec_chdir(const struct BFTW *ftwbuf) { while (end > path && end[-1] != '/') { --end; } - if (end > path) { + if (end == path) { + // The path is something like "foo", so we're already in the + // right directory + return; + } else { *end = '\0'; } |