summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-05-02 14:58:37 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-05-02 20:23:48 (GMT)
commitc1aee1fd8d94da9b3c5d2dc1d4264f7e73a58f80 (patch)
tree085574fab11a09351322ad58a6e66ec3cf0a4c22
parentcfa24e184a67cc36f414d913cf705d31e70a7a1a (diff)
downloadgit-c1aee1fd8d94da9b3c5d2dc1d4264f7e73a58f80.zip
git-c1aee1fd8d94da9b3c5d2dc1d4264f7e73a58f80.tar.gz
git-c1aee1fd8d94da9b3c5d2dc1d4264f7e73a58f80.tar.bz2
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>
-rw-r--r--config.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/config.c b/config.c
index 4e1f0c2..253c48a 100644
--- a/config.c
+++ b/config.c
@@ -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;
}
}