repo-config: trim white-space before comment
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>
This commit is contained in:
parent
cfa24e184a
commit
c1aee1fd8d
12
config.c
12
config.c
@ -60,6 +60,12 @@ static char *parse_value(void)
|
|||||||
space = 1;
|
space = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!quote) {
|
||||||
|
if (c == ';' || c == '#') {
|
||||||
|
comment = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (space) {
|
if (space) {
|
||||||
if (len)
|
if (len)
|
||||||
value[len++] = ' ';
|
value[len++] = ' ';
|
||||||
@ -93,12 +99,6 @@ static char *parse_value(void)
|
|||||||
quote = 1-quote;
|
quote = 1-quote;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!quote) {
|
|
||||||
if (c == ';' || c == '#') {
|
|
||||||
comment = 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
value[len++] = c;
|
value[len++] = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user