]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tac: fall back to /tmp if $TMPDIR is unavailable
authorPádraig Brady <P@draigBrady.com>
Tue, 18 Jul 2023 14:39:05 +0000 (15:39 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 18 Jul 2023 22:10:40 +0000 (23:10 +0100)
commit1b86b70dd5118462ba9388742ebd8459d0b84156
tree52863ee29d028af7afe4fc1c6dc8c4e721e758da
parent47e1388d6fe4a8015de8f3c5521ed851aef6a193
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.
NEWS
po/POTFILES.in
src/local.mk
src/tac.c
src/temp-stream.c [new file with mode: 0644]
src/temp-stream.h [new file with mode: 0644]
tests/tac/tac.pl