1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 11:16:16 +02:00

tac: don't misbehave with multiple non-seekable inputs

* src/tac.c (copy_to_temp): Do not reuse the template buffer.
Instead, scribble only on a freshly-xstrdup'd copy each time.
Free that buffer both here, upon failure, and ...
(tac_nonseekable): ...free the buffer in caller, upon success.
* tests/misc/tac-2-nonseekable: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
Reported by Ambrose Feinstein in http://debbugs.gnu.org/9762.
This commit is contained in:
Jim Meyering
2011-10-16 12:07:05 +02:00
parent 60cd4c271d
commit 537f9da37f
4 changed files with 48 additions and 4 deletions

View File

@@ -274,6 +274,7 @@ TESTS = \
misc/sum-sysv \
misc/tac \
misc/tac-continue \
misc/tac-2-nonseekable \
misc/tail \
misc/tee \
misc/tee-dash \