summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2013-08-08 20:47:05 +0200
committerAlbert Astals Cid <aacid@kde.org>2013-08-08 20:47:05 +0200
commitb8b5773386ee4f57e72c2b867421cdff8a2eab5a (patch)
tree1d13fe48df4d0b2975dd80d18edad23cf4a637d1 /utils
parent5f9d385dbec3148614b84ae24cae47177e18dbfc (diff)
parent62d079b40a2f816f59cc533b1624ea57458331f3 (diff)
Merge remote-tracking branch 'origin/poppler-0.24'
Diffstat (limited to 'utils')
-rw-r--r--utils/pdftotext.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index a170f1b7..3b8b69f2 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -22,6 +22,7 @@
// Copyright (C) 2010 Kenneth Berland <ken@hero.com>
// Copyright (C) 2011 Tom Gleason <tom@buildadam.com>
// Copyright (C) 2011 Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk>
+// Copyright (C) 2013 Yury G. Kudryashov <urkud.urkud@gmail.com>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
@@ -331,21 +332,17 @@ int main(int argc, char *argv[]) {
info.free();
fputs("</head>\n", f);
fputs("<body>\n", f);
- if (!bbox) fputs("<pre>\n", f);
- if (f != stdout) {
- fclose(f);
+ if (!bbox) {
+ fputs("<pre>\n", f);
+ if (f != stdout) {
+ fclose(f);
+ }
}
}
// write text file
if (bbox) {
textOut = new TextOutputDev(NULL, physLayout, fixedPitch, rawOrder, htmlMeta);
- if (!(f = fopen(textFileName->getCString(), "ab"))) {
- error(errIO, -1, "Couldn't open text file '{0:t}' for append", textFileName);
- exitCode = 2;
- delete textOut;
- goto err3;
- }
if (textOut->isOk()) {
fprintf(f, "<doc>\n");