]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r200442:
authorjh <jh@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 17 Aug 2010 15:02:33 +0000 (15:02 +0000)
committerjh <jh@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 17 Aug 2010 15:02:33 +0000 (15:02 +0000)
commitcad0d820d4c7f78c54e55b529c56a54339d24385
treebad6d2f7524f4f82b9cd9a2f088652f02f365553
parent833d0aa56cde48241072a14e2cea2ada3959159e
MFC r200442:

Don't read the newline character to line buffer because lines are passed
to wcscoll(3). Newline characters could cause incorrect results when
comparing lines.

Also, if an input line didn't contain a newline character, it was
omitted from the output. According to my interpretation, SUSv3 requires
that the newline is always printed.

Add regression tests for the cases.

PR: bin/140976

MFC r200604:

- Prevent overflowing of the buffer length variable in getline() by
  limiting its maximum value.
- Exit if reallocf(3) fails in getline(). Failure was silently
  considered as end-of-file.

MFC r204896 by ache:

Rewrite input processing to not exit with error on the first EILSEQ found
in the input data but fallback to "binary comparison" instead.

POSIX says: "The input files shall be text files", nothing more,
so the text file with illegal sequence is valid input.
BTW, GNU sort does not fails on EILSEQ too.

MFC r204928 by ache:

Add SIZE_MAX overflow check

git-svn-id: svn://svn.freebsd.org/base/stable/8@211428 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
14 files changed:
tools/regression/usr.bin/Makefile
tools/regression/usr.bin/comm/Makefile [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.00.out [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.00a.in [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.00b.in [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.01.out [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.01a.in [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.01b.in [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.02.out [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.02a.in [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.02b.in [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.sh [new file with mode: 0644]
tools/regression/usr.bin/comm/regress.t [new file with mode: 0644]
usr.bin/comm/comm.c