[Bug 252515] diff incorrectly reports files as different when with -q -w options set

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jan 8 13:06:29 UTC 2021


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

            Bug ID: 252515
           Summary: diff incorrectly reports files as different when with
                    -q -w options set
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: freebsd-bugzilla at thismonkey.com

Two files that differ only in white space are NOT reported as different with
just the `-w' option set but ARE reported as different when `-q' is also set.

# echo "hello  there" > /tmp/h1
# echo "hello there" > /tmp/h2
# diff -w /tmp/h1 /tmp/h2
# diff -qw /tmp/h1 /tmp/h2
Files /tmp/h1 and /tmp/h2 differ

Exit codes are also wrong (the second diff command above returns 1).

This is irrespective of long or short options names.

My reading of the man page suggests the `-q' option should not change the
behaviour of `-w'.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list