$OpenBSD: patch-foomaticrip_c,v 1.6 2011/08/25 10:39:46 ajacoutot Exp $

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

--- foomaticrip.c.orig	Mon Jul 25 23:29:09 2011
+++ foomaticrip.c	Thu Aug 25 12:11:40 2011
@@ -1068,6 +1068,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);
 
@@ -1099,6 +1100,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);
 
