summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 079fe1d)
raw | patch | inline | side by side (parent: 079fe1d)
author | J. Bruce Fields <bfields@citi.umich.edu> | |
Sun, 16 Dec 2007 17:58:01 +0000 (12:58 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 16 Dec 2007 22:03:36 +0000 (14:03 -0800) |
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>
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>
builtin-apply.c | patch | blob | history |
diff --git a/builtin-apply.c b/builtin-apply.c
index 2edd83bf40f51f52e58737ef5e7220ae70afb6e1..bd94a4bdb02cae54641cc56582c9b9155cdeb4dd 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
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;
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;
}