summaryrefslogtreecommitdiff
path: root/libspectre
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-12-11 14:05:21 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2009-12-11 14:08:23 +0100
commit5f261f571d1cd6bbd6dd12ca5eacb0edc79ebc06 (patch)
tree7c478ae9c0d778b49bbbb7b160acd86b38fb2fab /libspectre
parent889996f195d0a432f1e2a72645d6700aab96764c (diff)
Skip documents in the Prolog like Resource-Font
Fixes bug #25573.
Diffstat (limited to 'libspectre')
-rw-r--r--libspectre/ps.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libspectre/ps.c b/libspectre/ps.c
index a5cfeb1..f4cb481 100644
--- a/libspectre/ps.c
+++ b/libspectre/ps.c
@@ -864,6 +864,20 @@ psscan(const char *filename, int scanstyle)
iscomment(line+2, "Page:") ||
iscomment(line+2, "Trailer") ||
iscomment(line+2, "EOF")))) {
+ if (iscomment(line, "%!PS")) {
+ /* Embedded document in Prolog, typically font resources.
+ * Skip until end of resource or Prolog
+ */
+ while (readline(fd, enddoseps, &line, &position, &line_len) &&
+ !(DSCcomment(line) &&
+ (iscomment(line+2, "EndProlog") ||
+ iscomment(line+2, "BeginSetup") ||
+ iscomment(line+2, "Page:") ||
+ iscomment(line+2, "Trailer") ||
+ iscomment(line+2, "EOF")))) {
+ section_len += line_len;
+ }
+ }
if (!preread) section_len += line_len;
preread = 0;
}