diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2007-12-16 12:58:01 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-16 14:03:36 -0800 |
commit | 95f9b92700585eb9afa6978c350dc07ec5769ec6 (patch) | |
tree | 367460d026cd9fb0dea5d1e95b7061d4b95b486a /builtin-apply.c | |
parent | 079fe1dae8504c988c50ce41eba78743d3f588e0 (diff) | |
download | git-95f9b92700585eb9afa6978c350dc07ec5769ec6.tar.gz |
builtin-apply: minor cleanup of whitespace detection
Use 0 instead of -1 for the case where not tabs or spaces are found; it
will make some later math slightly simpler.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-apply.c')
-rw-r--r-- | builtin-apply.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin-apply.c b/builtin-apply.c index 2edd83bf40..bd94a4bdb0 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -1550,8 +1550,8 @@ static int apply_line(char *output, const char *patch, int plen, int i; int add_nl_to_tail = 0; int fixed = 0; - int last_tab_in_indent = -1; - int last_space_in_indent = -1; + int last_tab_in_indent = 0; + int last_space_in_indent = 0; int need_fix_leading_space = 0; char *buf; @@ -1582,12 +1582,12 @@ static int apply_line(char *output, const char *patch, int plen, if (ch == '\t') { last_tab_in_indent = i; if ((ws_rule & WS_SPACE_BEFORE_TAB) && - 0 <= last_space_in_indent) + 0 < last_space_in_indent) need_fix_leading_space = 1; } else if (ch == ' ') { last_space_in_indent = i; if ((ws_rule & WS_INDENT_WITH_NON_TAB) && - last_tab_in_indent < 0 && + last_tab_in_indent <= 0 && 8 <= i) need_fix_leading_space = 1; } |