Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-01-08 01:31:56 +0300
committerJunio C Hamano <junkio@cox.net>2006-01-08 08:34:02 +0300
commit0907fedbeea12aa78a66b9d765b0e618a180b6ff (patch)
tree8141531bc019bb72d621d21f022e7a13fb3f0c26 /ls-files.c
parent657907e76e298cac31845dadda2c71b431d9e712 (diff)
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>
Diffstat (limited to 'ls-files.c')
-rw-r--r--ls-files.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ls-files.c b/ls-files.c
index cc5b32e8ba..b29fe1be7e 100644
--- a/ls-files.c
+++ b/ls-files.c
@@ -293,11 +293,12 @@ static void read_directory(const char *path, const char *base, int baselen)
/* fallthrough */
case DT_DIR:
memcpy(fullname + baselen + len, "/", 2);
+ len++;
if (show_other_directories &&
- !dir_exists(fullname, baselen + len + 1))
+ !dir_exists(fullname, baselen + len))
break;
read_directory(fullname, fullname,
- baselen + len + 1);
+ baselen + len);
continue;
case DT_REG:
case DT_LNK: