diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-09-14 08:59:32 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-09-14 08:59:32 +0000 |
commit | 81bdc9b3c75ac1f42cd7da0dc2ece5a688993546 (patch) | |
tree | 57bc74a0b0f436f84dc1afc840d1457c8fe160b2 /Build | |
parent | b924a229df1189636b58be0367178ccadf423adb (diff) |
pdftosrc.cc: Fix a potential bug which I introduced on 2017-08-13
git-svn-id: svn://tug.org/texlive/trunk@45299 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftosrc.cc | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index 41629f27c5a..8ecdff2ce2b 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,8 @@ +2017-09-14 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * pdftosrc.cc: Fix a potential bug which I introduced on + 2017-08-13. + 2017-08-13 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * pdftosrc.cc: Remove a line, which I believe is not necessary, diff --git a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc index eb05da8ae3a..b4b0d1adb96 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc +++ b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc @@ -153,6 +153,7 @@ int main(int argc, char *argv[]) (e->type == xrefEntryFree ? "f" : "n")); else { // e->offset is the object number of the object stream Stream *str; + Lexer *lexer; Parser *parser; Object objStr, obj1, obj2; int nObjects, first, n; @@ -170,7 +171,8 @@ int main(int argc, char *argv[]) objStr.streamReset(); obj1.initNull(); str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first); - parser = new Parser(xref, new Lexer(xref, str), gFalse); + lexer = new Lexer(xref, str); + parser = new Parser(xref, lexer, gFalse); for (n = 0; n < nObjects; ++n) { parser->getObj(&obj1); parser->getObj(&obj2); @@ -179,12 +181,11 @@ int main(int argc, char *argv[]) obj1.free(); obj2.free(); } -/* The stream str is local, and it is never used hereafter. - When parser is deleted, Lexer(xref, str), and the stream str - are automatically deleted. Thus this line, which causes a crash - in the case of xpdf-4.00, is not necessary. +#ifdef POPPLER_VERSION /* 0.57.0 or older (or xpdf 3.04) */ while (str->getChar() != EOF) ; -*/ +#else /* xpdf 4.00 */ + lexer->skipToEOF(); +#endif delete parser; objStr.free(); |