$OpenBSD: patch-foomaticrip_c,v 1.8 2012/04/11 15:47:48 ajacoutot Exp $

From pkgsrc.
Prevent bogus 'Job does not start with "%!", is it PostScript?' errors.

--- foomaticrip.c.orig	Fri Mar 23 13:28:34 2012
+++ foomaticrip.c	Wed Apr 11 17:43:02 2012
@@ -180,7 +180,7 @@ char cupsfilterpath[PATH_MAX] = "/usr/local/lib/cups/f
                                 "/opt/cups/filter:"
                                 "/usr/lib/cups/filter";
 
-char modern_shell[64] = "/bin/bash";
+char modern_shell[64] = "/bin/ksh";
 
 void config_set_option(const char *key, const char *value)
 {
@@ -1076,6 +1076,7 @@ int print_file(const char *filename, int convert)
                 if (dup2(fileno(out), fileno(stdin)) < 0)
                     rip_die(EXIT_PRNERR_NORETRY_BAD_SETTINGS,
                             "Couldn't dup stdout of pdf-to-ps\n");
+		rewind(stdin);
 
                 ret = print_file("<STDIN>", 0);
 
@@ -1107,6 +1108,7 @@ int print_file(const char *filename, int convert)
             /* Read further data from the file converter and not from STDIN */
             if (dup2(fileno(fchandle), fileno(stdin)) < 0)
                 rip_die(EXIT_PRNERR_NORETRY_BAD_SETTINGS, "Couldn't dup fileconverterhandle\n");
+	    rewind(stdin);
 
             ret = print_file("<STDIN>", 0);
 
