mirror of
https://https.git.savannah.gnu.org/git/diffutils.git
synced 2026-01-27 01:44:20 +00:00
* tests/binary: Reverse arguments to compare to avoid failure of new syntax-check rule. * configure.ac: Use -Wno-format-nonliteral. Mark functions as pure of const, per recommendations enabled by new gcc -W options. Use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST. * lib/cmpbuf.h (buffer_lcm, block_compare): Apply pure and/or const attributes. * src/cmp.c (block_compare): Likewise. * src/context.c (find_hunk): Likewise. * src/diff.h (lines_differ): Likewise. * src/diff3.c (skipwhite): Likewise. * src/dir.c (dir_loop): Likewise. * src/util.c (find_change, find_reverse_change): Likewise. (translate_line_number): Likewise.
18 lines
359 B
Bash
Executable File
18 lines
359 B
Bash
Executable File
#!/bin/sh
|
|
# small examples
|
|
|
|
. "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|
|
|
printf 'Binary files - and /dev/null differ\n' > out-exp || fail_ setup
|
|
|
|
fail=0
|
|
|
|
printf '\0'|diff - /dev/null > out 2> err
|
|
|
|
# diff must exit with status 2, stdout as above, and no stderr.
|
|
test $? = 2 || fail=1
|
|
compare out-exp out || fail=1
|
|
compare /dev/null err || fail=1
|
|
|
|
Exit $fail
|