ls-files --others --directory: give trailing slash
This adds a trailing slash to directory names in the output when "--others --directory" option shows only untracked directories and not their contents, to make them stand out. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 7, 2006 at 14:31 UTC
0907fedbeea12aa78a66b9d765b0e618a180b6ff
1 file changed
+3
-2
ls-files.c
+3
-2
@@ -293,11 +293,12 @@ static void read_directory(const char *path, const char *base, int baselen)
293
/* fallthrough */
294
case DT_DIR:
295
memcpy(fullname + baselen + len, "/", 2);
296
+ len++;
297
if (show_other_directories &&
297
- !dir_exists(fullname, baselen + len + 1))
298
+ !dir_exists(fullname, baselen + len))
299
break;
300
read_directory(fullname, fullname,
300
- baselen + len + 1);
301
+ baselen + len);
302
continue;
303
case DT_REG:
304
case DT_LNK: