a2ps/a2ps-shell.patch
cvsdist b598a9d6a5 auto-import changelog data from a2ps-4.13b-40.src.rpm
Thu Jul 29 2004 Tim Waugh <twaugh@redhat.com> 4.13b-40
- Use environment variable to pass filenames to shell (bug #128647).
2004-09-09 02:54:53 +00:00

15 lines
681 B
Diff

--- a2ps-4.13/src/select.c.shell 2004-07-29 16:43:08.178940204 +0100
+++ a2ps-4.13/src/select.c 2004-07-29 16:43:09.328722698 +0100
@@ -148,8 +148,10 @@
command = ALLOCA (char, (2
+ strlen (job->file_command)
+ ustrlen (filename)));
- sprintf (command, "%s %s", job->file_command, (const char *) filename);
- message (msg_tool, (stderr, "Reading pipe: `%s'\n", command));
+ setenv ("filename", (const char *) filename, 1);
+ sprintf (command, "%s \"${filename}\"", job->file_command);
+ message (msg_tool, (stderr, "Reading pipe: `%s' [filename=%s]\n", command,
+ (const char *) filename));
file_out = popen (command, "r");
/* Check for failure */