https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252542

Ed Maste <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |In Progress
           Assignee|[email protected]            |[email protected]

--- Comment #1 from Ed Maste <[email protected]> ---
In the man page,
     -z      For regular files compare file sizes first, and fail the
             comparison if they are not equal.
so I think this is expected behaviour with -z; do you agree?

For -s this is certainly a bug; I'm considering this as a fix:


diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index c762f1346abf..47f9b671985c 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -92,7 +92,6 @@ main(int argc, char *argv[])
                        break;
                case 's':               /* silent run */
                        sflag = true;
-                       zflag = true;
                        break;
                case 'x':               /* hex output */
                        lflag = true;
@@ -149,6 +148,9 @@ main(int argc, char *argv[])
        skip1 = argc > 2 ? strtol(argv[2], NULL, 0) : 0;
        skip2 = argc == 4 ? strtol(argv[3], NULL, 0) : 0;

+       if (sflag && skip1 == 0 && skip2 == 0)
+               zflag = true;
+
        if (fd1 == -1) {
                if (fd2 == -1) {
                        c_link(file1, skip1, file2, skip2);

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to