builtin-apply: stronger indent-with-on-tab fixing
authorJ. Bruce Fields <bfields@citi.umich.edu>
Sun, 16 Dec 2007 17:58:02 +0000 (12:58 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 16 Dec 2007 22:03:40 +0000 (14:03 -0800)
Fix any sequence of 8 spaces in initial indent, not just the case where
the 8 spaces are the first thing on the line.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-apply.c
index bd94a4bdb02cae54641cc56582c9b9155cdeb4dd..5e3b4a14470ba1e97d98dd1721d9d4f6c44d6dc8 100644 (file)
@@ -1587,8 +1587,7 @@ static int apply_line(char *output, const char *patch, int plen,
                } else if (ch == ' ') {
                        last_space_in_indent = i;
                        if ((ws_rule & WS_INDENT_WITH_NON_TAB) &&
-                           last_tab_in_indent <= 0 &&
-                           8 <= i)
+                           8 <= i - last_tab_in_indent)
                                need_fix_leading_space = 1;
                }
                else