diff options
author | Frank Lichtenheld <frank@lichtenheld.de> | 2008-02-11 01:23:03 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-10 18:42:06 -0800 |
commit | 7a31cc0f96681d6cba54b38bb87daa2440bef448 (patch) | |
tree | e3305fc2187232fdf8cf67c34a21409670126a77 /config.c | |
parent | 527270689c364bea9b0630df9bae5e09c2071c1e (diff) | |
download | git-7a31cc0f96681d6cba54b38bb87daa2440bef448.tar.gz git-7a31cc0f96681d6cba54b38bb87daa2440bef448.tar.xz |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |