summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2007-02-24 12:24:27 +0100
committerJim Meyering <jim@meyering.net>2007-02-24 12:24:27 +0100
commit3ea177e3fa5a42dfe01b63b4c854c3478a1ea60d (patch)
tree5a2b3fc32078f94f4fb8450a4ff5181c3eced7b8 /src
parent75460e090c5bd114912a659ad73e469c08a2d60c (diff)
downloadcoreutils-3ea177e3fa5a42dfe01b63b4c854c3478a1ea60d.tar.xz
* NEWS: sort no longer compresses temporaries by default.
* bootstrap.conf: Remove findprog. * doc/coreutils.texi (sort invocation): The default is to not compress. Don't treat "" specially. * src/sort.c: Don't include findprog.h. (create_temp): Compress only if the user specified --compress-program. * tests/misc/sort-compress: Adjusts tests to match new behavior.
Diffstat (limited to 'src')
-rw-r--r--src/sort.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/sort.c b/src/sort.c
index 6a7de9c52..58ca66a2e 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -30,7 +30,6 @@
#include "system.h"
#include "argmatch.h"
#include "error.h"
-#include "findprog.h"
#include "hard-locale.h"
#include "hash.h"
#include "inttostr.h"
@@ -847,14 +846,7 @@ create_temp (FILE **pfp, pid_t *ppid)
struct tempnode *node = create_temp_file (&tempfd);
char *name = node->name;
- if (! compress_program)
- {
- static char const default_compress_program[] = "gzip";
- char const *prog = find_in_path (default_compress_program);
- compress_program = (prog == default_compress_program ? "" : prog);
- }
-
- if (*compress_program)
+ if (compress_program)
{
int pipefds[2];
@@ -875,8 +867,7 @@ create_temp (FILE **pfp, pid_t *ppid)
dup2_or_die (pipefds[0], STDIN_FILENO);
close (pipefds[0]);
- if (execlp (compress_program, compress_program,
- (char *) NULL) < 0)
+ if (execlp (compress_program, compress_program, (char *) NULL) < 0)
error (SORT_FAILURE, errno, _("couldn't execute %s"),
compress_program);
}
@@ -925,8 +916,7 @@ open_temp (const char *name, pid_t pid)
dup2_or_die (pipefds[1], STDOUT_FILENO);
close (pipefds[1]);
- if (execlp (compress_program, compress_program,
- "-d", (char *) NULL) < 0)
+ if (execlp (compress_program, compress_program, "-d", (char *) NULL) < 0)
error (SORT_FAILURE, errno, _("couldn't execute %s -d"),
compress_program);
}