diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2006-05-02 16:58:37 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-05 14:34:47 -0700 |
commit | 7ebdba614223f867d3f19963647406df1d0e5ce0 (patch) | |
tree | f5701cd29cbc27db905187fce3e442909ef49150 /config.c | |
parent | 93ddef3e2dd5f7f3238fad9d52e974d03c7844f2 (diff) | |
download | git-7ebdba614223f867d3f19963647406df1d0e5ce0.tar.gz |
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>
(cherry picked from c1aee1fd8d94da9b3c5d2dc1d4264f7e73a58f80 commit)
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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++] = ' '; @@ -93,12 +99,6 @@ static char *parse_value(void) quote = 1-quote; continue; } - if (!quote) { - if (c == ';' || c == '#') { - comment = 1; - continue; - } - } value[len++] = c; } } |