Imported Upstream version 2.8.4
[platform/upstream/man-db.git] / lib / decompress.c
index 419212a..02b3ec0 100644 (file)
@@ -88,12 +88,9 @@ pipeline *decompress_open (const char *filename)
 #ifdef HAVE_LIBZ
        filename_len = strlen (filename);
        if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) {
-               /* informational only; no shell quoting concerns */
-               char *name = xasprintf ("zcat < %s", filename);
-               cmd = pipecmd_new_function (name, &decompress_zlib, NULL,
+               cmd = pipecmd_new_function ("zcat", &decompress_zlib, NULL,
                                            NULL);
                pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
-               free (name);
                p = pipeline_new_commands (cmd, NULL);
                goto got_pipeline;
        }
@@ -108,7 +105,6 @@ pipeline *decompress_open (const char *filename)
                                continue;
 
                        cmd = pipecmd_new_argstr (comp->prog);
-                       pipecmd_arg (cmd, filename);
                        pipecmd_pre_exec (cmd, sandbox_load, sandbox_free,
                                          sandbox);
                        p = pipeline_new_commands (cmd, NULL);
@@ -120,8 +116,7 @@ pipeline *decompress_open (const char *filename)
        /* HP-UX */
        ext = strstr (filename, ".Z/");
        if (ext) {
-               cmd = pipecmd_new_argstr (GUNZIP " -S \"\"");
-               pipecmd_arg (cmd, filename);
+               cmd = pipecmd_new_argstr (GUNZIP);
                pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
                p = pipeline_new_commands (cmd, NULL);
                goto got_pipeline;