summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-11-25 23:36:58 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2005-11-25 23:36:58 -0800
commit2d76d0d151239538c43b61572283405b10df43ac (patch)
tree9ccf8849fa9b522a344645c2f28f12ab036e30d5
parentgit-mv is not able to handle big directories (diff)
downloadtgif-2d76d0d151239538c43b61572283405b10df43ac.tar.xz
name-rev: fix off-by-one error in --stdin.
It dropped the last hexdigit in the object name. [jc: Noticed and patch supplied by ALASCM, reworked to apply at the right place by me] Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--name-rev.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/name-rev.c b/name-rev.c
index 817e36b793..7d89401a41 100644
--- a/name-rev.c
+++ b/name-rev.c
@@ -217,10 +217,9 @@ int main(int argc, char **argv)
if (!strcmp(name, "undefined"))
continue;
- fwrite(p_start, p - p_start, 1, stdout);
- fputc('(', stdout);
- fputs(name, stdout);
- fputc(')', stdout);
+ fwrite(p_start, p - p_start + 1, 1,
+ stdout);
+ printf(" (%s)", name);
p_start = p + 1;
}
}