summaryrefslogtreecommitdiff
path: root/parse-options.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-06-14 07:27:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-06-14 18:39:16 (GMT)
commit44d86e910d61dab4f059d86705599bbb2747b10f (patch)
tree177b3233ec2c4f1629d421201b650cf5a6059f96 /parse-options.c
parent74f16b0c6fece88f585f9556fa1d3a7406e7a42e (diff)
downloadgit-44d86e910d61dab4f059d86705599bbb2747b10f.zip
git-44d86e910d61dab4f059d86705599bbb2747b10f.tar.gz
git-44d86e910d61dab4f059d86705599bbb2747b10f.tar.bz2
avoid whitespace on empty line in automatic usage message
When outputting a usage message with a blank line in the header, we would output a line with four spaces. Make this truly a blank line. This helps us remove trailing whitespace from a test vector. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse-options.c b/parse-options.c
index acf3fe3..8071711 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -312,8 +312,12 @@ void usage_with_options_internal(const char * const *usagestr,
fprintf(stderr, "usage: %s\n", *usagestr++);
while (*usagestr && **usagestr)
fprintf(stderr, " or: %s\n", *usagestr++);
- while (*usagestr)
- fprintf(stderr, " %s\n", *usagestr++);
+ while (*usagestr) {
+ fprintf(stderr, "%s%s\n",
+ **usagestr ? " " : "",
+ *usagestr);
+ usagestr++;
+ }
if (opts->type != OPTION_GROUP)
fputc('\n', stderr);