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
commit4cb4effaad8c0b363678c620e8e5cd7d6ff13e77 (patch)
tree10231b279914a2cbc94f56e577c7aaffa94d9af9 /foomatic-gswrapper.in
parent36e5a21d1ca4d27d217e044ef28757c9a03eff99 (diff)
parent5294ceb9d1eb5d4dd512cffaac0db5c0af261fdc (diff)
Merge branch 'upstream'
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;
}