summaryrefslogtreecommitdiff
path: root/src/sort.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-04-18 14:40:20 +0000
committerJim Meyering <jim@meyering.net>1999-04-18 14:40:20 +0000
commit8cee2c67721043ad9e37bad0936e16f5996668ca (patch)
tree3b0653a7e0f4f4cd93919ac3e5b0a3aa0a5b7a87 /src/sort.c
parenteb4109b66e63a46790e6c07c555412e1edef2df9 (diff)
downloadcoreutils-8cee2c67721043ad9e37bad0936e16f5996668ca.tar.xz
Rename global: s/temp_file_prefix/temp_dir/.
Diffstat (limited to 'src/sort.c')
-rw-r--r--src/sort.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/sort.c b/src/sort.c
index b62cd5e48..d932f409c 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -248,8 +248,8 @@ static int linelength = 30;
/* Maximum number of elements for the array(s) of struct line's, in bytes. */
#define LINEALLOC (256 * 1024)
-/* Prefix for temporary file names. */
-static char *temp_file_prefix;
+/* Directory in which any temporary files are to be created. */
+static char *temp_dir;
/* Flag to reverse the order of all comparisons. */
static int reverse;
@@ -434,9 +434,9 @@ static char *
tempname (void)
{
static unsigned int seq;
- int len = strlen (temp_file_prefix);
+ int len = strlen (temp_dir);
char *name = xmalloc (len + 1 + sizeof ("sort") - 1 + 5 + 5 + 1);
- int long_file_names = PATH_MAX_IN_DIR (temp_file_prefix) > 12;
+ int long_file_names = PATH_MAX_IN_DIR (temp_dir) > 12;
struct tempnode *node;
node = (struct tempnode *) xmalloc (sizeof (struct tempnode));
@@ -446,13 +446,13 @@ tempname (void)
if (long_file_names)
sprintf (name,
"%s%ssort%5.5d%5.5d",
- temp_file_prefix,
- (len && temp_file_prefix[len - 1] != '/') ? "/" : "",
+ temp_dir,
+ (len && temp_dir[len - 1] != '/') ? "/" : "",
(unsigned int) getpid () & 0xffff, seq);
else
sprintf (name, "%s%ss%5.5d%2.2d.%3.3d",
- temp_file_prefix,
- (len && temp_file_prefix[len - 1] != '/') ? "/" : "",
+ temp_dir,
+ (len && temp_dir[len - 1] != '/') ? "/" : "",
(unsigned int) getpid () & 0xffff, seq / 1000, seq % 1000);
/* Make sure that SEQ's value fits in 5 digits. */
@@ -2536,9 +2536,9 @@ main (int argc, char **argv)
have_read_stdin = 0;
inittables ();
- temp_file_prefix = getenv ("TMPDIR");
- if (temp_file_prefix == NULL)
- temp_file_prefix = DEFAULT_TMPDIR;
+ temp_dir = getenv ("TMPDIR");
+ if (temp_dir == NULL)
+ temp_dir = DEFAULT_TMPDIR;
/* Change the way xmalloc and xrealloc fail. */
xalloc_exit_failure = SORT_FAILURE;
@@ -2791,11 +2791,11 @@ but lacks following character offset"));
break;
case 'T':
if (s[1])
- temp_file_prefix = ++s;
+ temp_dir = ++s;
else
{
if (i < argc - 1)
- temp_file_prefix = argv[++i];
+ temp_dir = argv[++i];
else
error (SORT_FAILURE, 0,
_("option `-T' requires an argument"));