Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / print / foomatic4-filters / patches / patch-ac
blob9b1365010e2c52a750ceb86107abfd3d7b0ea011
1 $NetBSD$
3 --- foomaticrip.c.orig  2012-07-02 14:50:46.000000000 +0000
4 +++ foomaticrip.c
5 @@ -180,7 +180,7 @@ char cupsfilterpath[PATH_MAX] = "/usr/lo
6                                  "/opt/cups/filter:"
7                                  "/usr/lib/cups/filter";
8  
9 -char modern_shell[64] = "/bin/bash";
10 +char modern_shell[64] = "/bin/sh";
12  void config_set_option(const char *key, const char *value)
13  {
14 @@ -1014,7 +1014,7 @@ int print_file(const char *filename, int
16              if (!ppd_supports_pdf())
17              {
18 -                char pdf2ps_cmd[PATH_MAX];
19 +                char pdf2ps_cmd[FM_CMDLINE_MAX];
20                  FILE *out, *in;
21                  int renderer_pid;
22                 char tmpfilename[PATH_MAX] = "";
23 @@ -1060,12 +1060,12 @@ int print_file(const char *filename, int
24                    We give priority to Ghostscript here and use Poppler if
25                    Ghostscript is not available. */
26                 if (spooler == SPOOLER_CUPS)
27 -                 snprintf(pdf2ps_cmd, PATH_MAX,
28 +                 snprintf(pdf2ps_cmd, FM_CMDLINE_MAX,
29                            "pdftops '%s' '%s' '%s' '%s' '%s' '%s'",
30                            job->id, job->user, job->title, "1", job->optstr->data,
31                            filename);
32                 else
33 -                 snprintf(pdf2ps_cmd, PATH_MAX,
34 +                 snprintf(pdf2ps_cmd, FM_CMDLINE_MAX,
35                            "gs -q -sstdout=%%stderr -sDEVICE=ps2write -sOutputFile=- "
36                            "-dBATCH -dNOPAUSE -dPARANOIDSAFER -dNOINTERPOLATE %s 2>/dev/null || "
37                            "pdftops -level2 -origpagesizes %s - 2>/dev/null",
38 @@ -1076,6 +1076,7 @@ int print_file(const char *filename, int
39                  if (dup2(fileno(out), fileno(stdin)) < 0)
40                      rip_die(EXIT_PRNERR_NORETRY_BAD_SETTINGS,
41                              "Couldn't dup stdout of pdf-to-ps\n");
42 +               rewind(stdin);
44                  ret = print_file("<STDIN>", 0);
46 @@ -1107,6 +1108,7 @@ int print_file(const char *filename, int
47              /* Read further data from the file converter and not from STDIN */
48              if (dup2(fileno(fchandle), fileno(stdin)) < 0)
49                  rip_die(EXIT_PRNERR_NORETRY_BAD_SETTINGS, "Couldn't dup fileconverterhandle\n");
50 +           rewind(stdin);
52              ret = print_file("<STDIN>", 0);