summaryrefslogtreecommitdiff
path: root/foomatic-rip.in
diff options
context:
space:
mode:
Diffstat (limited to 'foomatic-rip.in')
-rwxr-xr-xfoomatic-rip.in23
1 files changed, 20 insertions, 3 deletions
diff --git a/foomatic-rip.in b/foomatic-rip.in
index 177b372..5b0415b 100755
--- a/foomatic-rip.in
+++ b/foomatic-rip.in
@@ -5,7 +5,7 @@ use strict;
use POSIX;
use Cwd;
-my $ripversion='$Revision: 3.43.2.9 $';
+my $ripversion='$Revision: 3.43.2.11 $';
#'# Fix emacs syntax highlighting
# foomatic-rip is a spooler-independent filter script which takes
@@ -664,6 +664,18 @@ if ($spooler eq 'ppr') {
my( $cups_jobid, $cups_user, $cups_jobtitle, $cups_copies, $cups_options,
$cups_filename );
if ($spooler eq 'cups') {
+
+ # Use CUPS font path ("FontPath" in /etc/cups/cupsd.conf)
+ if ($ENV{'CUPS_FONTPATH'}) {
+ $ENV{'GS_LIB'} = $ENV{'CUPS_FONTPATH'} .
+ ($ENV{'GS_LIB'} ? ":$ENV{'GS_LIB'}" : "");
+ } else {
+ if ($ENV{'CUPS_DATADIR'}) {
+ $ENV{'GS_LIB'} = "$ENV{'CUPS_DATADIR'}/fonts" .
+ ($ENV{'GS_LIB'} ? ":$ENV{'GS_LIB'}" : "");
+ }
+ }
+
# Get all command line parameters
$cups_jobid = removeshellescapes($rargs[0]);
$cups_user = removeshellescapes($rargs[1]);
@@ -1661,6 +1673,8 @@ if (($debug) || ($spooler ne 'cups')) {
}
print $logh "Job title: $jobtitle\n";
print $logh "File(s) to be printed: ${added_lf}@filelist${added_lf}\n";
+print $logh "GhostScript extra search path ('GS_LIB'): $ENV{'GS_LIB'}\n"
+ if $ENV{'GS_LIB'};
@@ -2417,8 +2431,7 @@ for $file (@filelist) {
}
} else {
# Do we have a DSC-conforming document?
- if (($line =~ m/^.?%!PS-Adobe-/) &&
- ($line !~ m/EPSF/)) {
+ if ($line =~ m/^.?%!PS-Adobe-/) {
# Do not stop parsing the document
if (!$dontparse) {
$maxlines = 0;
@@ -5073,6 +5086,8 @@ sub stringvalid {
# Allowed characters
if ($arg->{'allowedchars'}) {
my $chars = $arg->{'allowedchars'};
+ # Quote the slashes (if a slash is preceeded by an even number of
+ # backslashes, it is not already quoted)
$chars =~ s/(?<!\\)((\\\\)*)\//$2\\\//g;
return 0 if $value !~ /^[$chars]*$/;
}
@@ -5080,6 +5095,8 @@ sub stringvalid {
# Regular expression
if ($arg->{'allowedregexp'}) {
my $regexp = $arg->{'allowedregexp'};
+ # Quote the slashes (if a slash is preceeded by an even number of
+ # backslashes, it is not already quoted)
$regexp =~ s/(?<!\\)((\\\\)*)\//$2\\\//g;
return 0 if $value !~ /$regexp/;
}