mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-21 11:16:16 +02:00
tac: fall back to /tmp if $TMPDIR is unavailable
This also refactors temp_stream() to its own module, in preparation for use by split. * src/tac.c: Refactor temp_stream() out to ... * src/temp-stream.c: ... A new module mostly refactored from tac, but uses tmpdir to more robustly support $TMPDIR, while falling back to /tmp if not available. * src/temp-stream.h: The new module interface. * src/local.mk: Reference the new module from tac. * tests/tac/tac.pl: Adjust to non failing missing $TMPDIR. * po/POTFILES.in: Reference the new module with translatable strings. * NEWS: Mention the user visible improvements to tac TMPDIR handling.
This commit is contained in:
@@ -74,9 +74,7 @@ my @Tests =
|
||||
['pipe-bad-tmpdir',
|
||||
{ENV => "TMPDIR=$bad_dir"},
|
||||
{IN_PIPE => "a\n"},
|
||||
{ERR_SUBST => "s,'$bad_dir': .*,...,"},
|
||||
{ERR => "$prog: failed to create temporary file in ...\n"},
|
||||
{EXIT => 1}],
|
||||
{OUT=>"a\n"}],
|
||||
|
||||
# coreutils-8.5's tac would double-free its primary buffer.
|
||||
['double-free', {IN=>$long_line}, {OUT=>$long_line}],
|
||||
|
||||
Reference in New Issue
Block a user