summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-05-05 05:09:58 +0000
committerJim Meyering <jim@meyering.net>1995-05-05 05:09:58 +0000
commit6ebd309cb87e763f9cda2bac5f5ded1eefbbe75c (patch)
treee935ccbba1efd97929204d40f3a9202ea0ab5c04
parent151f4af0daf1eb669fd18b135c445080de389e20 (diff)
downloadcoreutils-6ebd309cb87e763f9cda2bac5f5ded1eefbbe75c.tar.xz
(save_stdin): Don't hard-code /tmp.
[DEFAULT_TMPDIR]: Use this instead.
-rw-r--r--src/tac.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tac.c b/src/tac.c
index 6ddaa1923..8ddfdd1fd 100644
--- a/src/tac.c
+++ b/src/tac.c
@@ -51,6 +51,10 @@ char *malloc ();
char *realloc ();
#endif
+#ifndef DEFAULT_TMPDIR
+#define DEFAULT_TMPDIR "/tmp"
+#endif
+
/* The number of bytes per atomic read. */
#define INITIAL_READSIZE 8192
@@ -363,7 +367,7 @@ save_stdin ()
{
tempdir = getenv ("TMPDIR");
if (tempdir == NULL)
- tempdir = "/tmp";
+ tempdir = DEFAULT_TMPDIR;
template = xmalloc (strlen (tempdir) + 11);
}
sprintf (template, "%s/tacXXXXXX", tempdir);