Skip to content

Commit

Permalink
repo-config: trim white-space before comment
Browse files Browse the repository at this point in the history
Earlier, calling

	git-repo-config core.hello

on a .git/config like this:

	[core]
		hello = world ; a comment

would yield "world " (i.e. with a trailing space).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from c1aee1f commit)
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed May 5, 2006
1 parent 93ddef3 commit 7ebdba6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ static char *parse_value(void)
space = 1;
continue;
}
if (!quote) {
if (c == ';' || c == '#') {
comment = 1;
continue;
}
}
if (space) {
if (len)
value[len++] = ' ';
Expand Down Expand Up @@ -93,12 +99,6 @@ static char *parse_value(void)
quote = 1-quote;
continue;
}
if (!quote) {
if (c == ';' || c == '#') {
comment = 1;
continue;
}
}
value[len++] = c;
}
}
Expand Down

0 comments on commit 7ebdba6

Please sign in to comment.