@matheusbsbs / matheus-bagliano / commits / c1aee1fd8d
Fork 0

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>

Johannes Schindelin committed May 2, 2006 at 16:58 UTC c1aee1fd8d94da9b3c5d2dc1d4264f7e73a58f80
1 file changed +6 -6
config.c
+6 -6
@@ -60,6 +60,12 @@ static char *parse_value(void)
60 space = 1;
61 continue;
62 }
63 + if (!quote) {
64 + if (c == ';' || c == '#') {
65 + comment = 1;
66 + continue;
67 + }
68 + }
69 if (space) {
70 if (len)
71 value[len++] = ' ';
@@ -93,12 +99,6 @@ static char *parse_value(void)
99 quote = 1-quote;
100 continue;
101 }
96 - if (!quote) {
97 - if (c == ';' || c == '#') {
98 - comment = 1;
99 - continue;
100 - }
101 - }
102 value[len++] = c;
103 }
104 }