*
* PostScript filter for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
setbuf(stderr, NULL);
+ /*
+ * Ignore broken pipe signals...
+ */
+
+ signal(SIGPIPE, SIG_IGN);
+
/*
* Check command-line...
*/
saw_bounding_box = 0;
saw_for = 0;
saw_pages = 0;
- saw_title = 0;
+ saw_title = 0;
while (line[0] == '%')
{
{
int pages; /* Number of pages */
- if (saw_pages)
+ if (saw_pages)
fputs("DEBUG: A duplicate %%Pages: comment was seen.\n", stderr);
saw_pages = 1;
}
else if (!strncmp(line, "%%BoundingBox:", 14))
{
- if (saw_bounding_box)
+ if (saw_bounding_box)
fputs("DEBUG: A duplicate %%BoundingBox: comment was seen.\n", stderr);
else if (strstr(line + 14, "(atend)"))
{
break;
}
- if (!saw_bounding_box)
+ if (!saw_bounding_box)
fputs("DEBUG: There wasn't a %%BoundingBox: comment in the header.\n",
stderr);
- if (!saw_pages)
+ if (!saw_pages)
fputs("DEBUG: There wasn't a %%Pages: comment in the header.\n", stderr);
if (!saw_for)
if (!strncmp(line, "%%EndProlog", 11))
linelen = cupsFileGetLine(fp, line, linesize);
- else
+ else
fputs("DEBUG: The %%EndProlog comment is missing.\n", stderr);
}
}
doc_puts(doc, "%%BeginSetup\n");
-
+
do_setup(doc, ppd);
num_options = 0;
if (!strncmp(line, "%%EndSetup", 10))
linelen = cupsFileGetLine(fp, line, linesize);
- else
+ else
fputs("DEBUG: The %%EndSetup comment is missing.\n", stderr);
}