summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-06-01 14:39:54 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2010-06-01 14:39:54 +0200
commitb389eb07cf793fec3a7c7cd4c75a2752a72f51ad (patch)
tree8fbc2747f93822b95aa0b49245aa082faa520ad5
parent64405a78fdce7e028d91bdc68ab497d4c8a53bf0 (diff)
Fix rendering of files with doseps header and EOF comment missing
Fixes bug #27830.
-rw-r--r--libspectre/ps.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libspectre/ps.c b/libspectre/ps.c
index c565841..6c7cfce 100644
--- a/libspectre/ps.c
+++ b/libspectre/ps.c
@@ -1184,8 +1184,15 @@ continuepage:
}
section_len += line_len;
if (DSCcomment(line) && iscomment(line+2, "EOF")) {
- readline(fd, enddoseps, &line, &position, &line_len);
+ readline(fd, enddoseps, &line, &position, &line_len);
section_len += line_len;
+ } else if (doc->doseps) {
+ /* No EOF, make sure endtrailer <= ps_end */
+ if (position > doc->doseps->ps_begin + doc->doseps->ps_length) {
+ position = doc->doseps->ps_begin + doc->doseps->ps_length;
+ section_len = position - doc->begintrailer;
+ line_len = 0;
+ }
}
doc->endtrailer = position;
doc->lentrailer = section_len - line_len;