From 3ea177e3fa5a42dfe01b63b4c854c3478a1ea60d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 24 Feb 2007 12:24:27 +0100 Subject: * 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. --- src/sort.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3-70-g09d2