summaryrefslogtreecommitdiff
path: root/foomatic-gswrapper.in
diff options
context:
space:
mode:
authorDidier Raboud <didier@raboud.com>2010-05-22 22:10:35 +0200
committerDidier Raboud <didier@raboud.com>2010-05-22 22:10:35 +0200
commit5294ceb9d1eb5d4dd512cffaac0db5c0af261fdc (patch)
tree32e91a20f74a3248be21cf232ad0d64af44badcf /foomatic-gswrapper.in
parent36c9ad50d5284ab11c55375c60902da12df61726 (diff)
Imported Upstream version 3.0.2-20050720upstream/3.0.2-20050720
Diffstat (limited to 'foomatic-gswrapper.in')
-rwxr-xr-xfoomatic-gswrapper.in11
1 files changed, 8 insertions, 3 deletions
diff --git a/foomatic-gswrapper.in b/foomatic-gswrapper.in
index f02bb52..1973013 100755
--- a/foomatic-gswrapper.in
+++ b/foomatic-gswrapper.in
@@ -1,6 +1,6 @@
#!@PERL@
# -*- perl -*-
-# $Revision: 3.4.2.3 $
+# $Revision: 3.4.2.5 $
# This is a little Ghostscript regularization script. It massages
# arguments to make Ghostscript execute properly as a filter, with
@@ -43,7 +43,12 @@ grep (((m!^\-$!) || (m!^\-_$!))
my @myargs = grep (! m!^\-q$!, @ARGV);
# Escape any quotes, and then quote everything just to be sure...
-grep (s!\'!\\\'!g, @myargs);
+
+# Escaping a single quote inside single quotes is a bit complex as the shell
+# takes everything literal there. So we have to assemble it by concatinating
+# different quoted strings.
+# Finally we get e.g.: 'x'"'"'y' or ''"'"'xy' or 'xy'"'"'' or ...
+grep (s/\'/\'\"\'\"\'/g, @myargs);
my $args = "'" . join("' '", @myargs) . "'";
# Execute Ghostscript, with both job and gs errors on stderr, and job
@@ -64,7 +69,7 @@ sub readConfFile {
if (open CONF, "< $file") {
while (<CONF>)
{
- $conf{$1}="$2" if (m/^\s*([^\#\s]\S*)\s*:\s*(.*)\s*$/);
+ $conf{$1}="$2" if (m/^\s*([^\#\s]\S*)\s*:\s*(.*?)\s*$/);
}
close CONF;
}