summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-26 07:36:58 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-26 07:36:58 (GMT)
commit2d76d0d151239538c43b61572283405b10df43ac (patch)
tree9ccf8849fa9b522a344645c2f28f12ab036e30d5
parentf359ae42ac102ef98d5708f1dc8b06e6af2701c1 (diff)
downloadgit-2d76d0d151239538c43b61572283405b10df43ac.zip
git-2d76d0d151239538c43b61572283405b10df43ac.tar.gz
git-2d76d0d151239538c43b61572283405b10df43ac.tar.bz2
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 817e36b..7d89401 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;
}
}