- When processing trailing spaces with --ignore-space-change a diff
would be found whenever an incomplete line terminated before the
whitespace handling started regardless of actual trailing-spaces.
xdl_recmatch should process the full length of the record instead
of assuming both sides have a terminator, and should treat the
terminator as a whitespace like it does with '\n'.
Signed-off-by: Thell Fowler <redacted>
---
xdiff/xutils.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/xdiff/xutils.c b/xdiff/xutils.c
index 1f28f4fb4e0a8fdc6c9aa1904cf0362dd1e7b977..e126de450c99fb1e557c2cfc0ffe54e8e3e80394 100644
--- a/xdiff/xutils.c
+++ b/xdiff/xutils.c
@@ -203,9 +203,9 @@ int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags)
}
return (i1 >= s1 && i2 >= s2);
} else if (flags & XDF_IGNORE_WHITESPACE_CHANGE) {
- for (i1 = i2 = 0; i1 < s1 && i2 < s2; ) {
- if (isspace(l1[i1])) {
- if (!isspace(l2[i2]))
+ for (i1 = i2 = 0; i1 <= s1 && i2 <= s2; ) {
+ if (isspace(l1[i1]) || (i1 == s1 && i2 < s2)) {
+ if (!isspace(l2[i2]) && i2 != s2)
return 0;
while (isspace(l1[i1]) && i1 < s1)
i1++;--
1.6.4.172.g5c0d0.dirty