summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorFrank Lichtenheld <frank@lichtenheld.de>2008-02-11 00:23:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-11 02:42:06 (GMT)
commit7a31cc0f96681d6cba54b38bb87daa2440bef448 (patch)
treee3305fc2187232fdf8cf67c34a21409670126a77 /config.c
parent527270689c364bea9b0630df9bae5e09c2071c1e (diff)
downloadgit-7a31cc0f96681d6cba54b38bb87daa2440bef448.zip
git-7a31cc0f96681d6cba54b38bb87daa2440bef448.tar.gz
git-7a31cc0f96681d6cba54b38bb87daa2440bef448.tar.bz2
config: Fix --unset for continuation lines
find_beginning_of_line didn't take into account that the previous line might have ended with \ in which case it shouldn't stop but continue its search. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.c b/config.c
index 526a3f4..e799f40 100644
--- a/config.c
+++ b/config.c
@@ -701,12 +701,17 @@ static ssize_t find_beginning_of_line(const char* contents, size_t size,
size_t equal_offset = size, bracket_offset = size;
ssize_t offset;
+contline:
for (offset = offset_-2; offset > 0
&& contents[offset] != '\n'; offset--)
switch (contents[offset]) {
case '=': equal_offset = offset; break;
case ']': bracket_offset = offset; break;
}
+ if (offset > 0 && contents[offset-1] == '\\') {
+ offset_ = offset;
+ goto contline;
+ }
if (bracket_offset < equal_offset) {
*found_bracket = 1;
offset = bracket_offset+1;