[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
serious bug in cmp from diffutils/cvs
From: |
Jim Meyering |
Subject: |
serious bug in cmp from diffutils/cvs |
Date: |
Sun, 07 May 2006 19:07:15 +0200 |
Hi Paul,
I tried out the latest diffutils, then ran coreutils' `make check'
and saw new failures. Tracked it back to this bug in `cmp'.
No test suite? Is one in the works?
Do you prefer autotest-based tests? Anyhow, maybe if you tell
us what framework you'd like, someone will contribute a few.
Demonstrate the bug (before the patch):
$ ./cmp <(echo b) <(echo a) > /dev/null && echo bug
bug
The fix works: after applying the patch:
$ ./cmp <(echo b) <(echo a) > /dev/null && echo bug
$
Test the other (inputs equal) case:
$ ./cmp <(echo a) <(echo a) > /dev/null || echo bug
$
2006-05-07 Jim Meyering <address@hidden>
cmp always exits successfully, when stdout is redirected to /dev/null
* src/cmp.c (cmp): When there's a difference, arrange to return nonzero
also when comparison_type is the new (from 2006-03-09) type_no_stdout.
Index: src/cmp.c
===================================================================
RCS file: /sources/diffutils/diffutils/src/cmp.c,v
retrieving revision 1.43
diff -u -p -r1.43 cmp.c
--- src/cmp.c 13 Mar 2006 19:11:17 -0000 1.43
+++ src/cmp.c 7 May 2006 16:55:37 -0000
@@ -540,6 +540,7 @@ cmp (void)
break;
case type_no_stdout:
+ ret = EXIT_FAILURE;
break;
}
}
- serious bug in cmp from diffutils/cvs,
Jim Meyering <=