[poppler] Branch 'poppler-0.24' - 2 commits - utils/pdftotext.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Nov 15 11:08:44 PST 2013


 utils/pdftotext.cc |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit c43a80e65fc570a8017892ba111a8c48ac33d9ad
Author: Hib Eris <hib at hiberis.nl>
Date:   Fri Nov 15 19:59:52 2013 +0100

    pdftotext: Silence warning for may be used uninitialized variable
    
    Bug #71640

diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index c592329..62ba3a3 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -341,7 +341,7 @@ int main(int argc, char *argv[]) {
   }
 
   // write text file
-  if (bbox) {
+  if (htmlMeta && bbox) { // htmlMeta && is superfluous but makes gcc happier
     textOut = new TextOutputDev(NULL, physLayout, fixedPitch, rawOrder, htmlMeta);
 
     if (textOut->isOk()) {
commit f905d804c0d1c715d8423938f41b5a002c0ef15d
Author: Hib Eris <hib at hiberis.nl>
Date:   Fri Nov 15 19:55:19 2013 +0100

    Do not close stdout in pdftotext
    
    Bug #71639

diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index 3b8b69f..c592329 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -18,7 +18,7 @@
 // Copyright (C) 2006 Dominic Lachowicz <cinamod at hotmail.com>
 // Copyright (C) 2007-2008, 2010, 2011 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2009 Jan Jockusch <jan at jockusch.de>
-// Copyright (C) 2010 Hib Eris <hib at hiberis.nl>
+// Copyright (C) 2010, 2013 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2010 Kenneth Berland <ken at hero.com>
 // Copyright (C) 2011 Tom Gleason <tom at buildadam.com>
 // Copyright (C) 2011 Steven Murdoch <Steven.Murdoch at cl.cam.ac.uk>
@@ -367,7 +367,9 @@ int main(int argc, char *argv[]) {
       }
       fprintf(f, "</doc>\n");
     }
-    fclose(f);
+    if (f != stdout) {
+      fclose(f);
+    }
   } else {
     textOut = new TextOutputDev(textFileName->getCString(),
 				physLayout, fixedPitch, rawOrder, htmlMeta);


More information about the poppler mailing list