diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-07-24 10:18:28 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-07-24 10:18:54 -0700 |
commit | ffd63aedad3c0eb08ebb27103e5f242f8732dc0c (patch) | |
tree | f8cf7b097768e72f7fa06def4df5c8f9dc50fc41 /tests | |
parent | 612db4defaabc086f0c4303499dc41aee003fc69 (diff) | |
download | diffutils-ffd63aedad3c0eb08ebb27103e5f242f8732dc0c.tar.gz |
cmp: fix bug in -b diagnostic
Problem reported by mancha (Bug#32249).
* src/cmp.c (count_newlines): Restore old value of sentinel.
* tests/cmp: Test for the bug.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cmp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -208,4 +208,14 @@ done >out1 compare exp1 out1 || fail=1 +printf 'bad\n' >bad +printf 'bug\n' >bug +echo LC_ALL=C cmp -b bad bug +LC_ALL=C cmp -b bad bug +test $? -eq 1 || fail=1 +case `LC_ALL=C cmp -b bad bug` in + 'bad bug differ: byte 2, line 1 is '*' a '*' u') ;; + *) echo 'expected cmp -b to report a and u'; fail=1;; +esac + Exit $fail |