Bug 83609

Summary: Exit code when file doesn't exist
Product: poppler Reporter: Juan Ibiapina <juanibiapina>
Component: pdftohtmlAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: mutley456
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Simple patch, adds variable exit_status and sets to EXIT_FAILURE before goto error

Description Juan Ibiapina 2014-09-08 11:50:06 UTC
Simplest problematic case is this:

    $ pdftohtml a.pdf

The exit status for this command is 0 if the file doesn't exist. It should be greater than 0.
Comment 1 Juan Ibiapina 2014-09-08 11:53:15 UTC
(In reply to comment #0)
> Simplest problematic case is this:
> 
>     $ pdftohtml a.pdf
> 
> The exit status for this command is 0 if the file doesn't exist. It should
> be greater than 0.

Tested on
OSX: pdftohtml version 0.26.3 installed using brew install poppler (v 0.26.3)
Debian: pdftohtml version 0.26.4 installed using apt-get install poppler-utils     (0.26.4-1)
Comment 2 Matt Atkinson 2015-02-23 11:20:08 UTC
Created attachment 113753 [details] [review]
Simple patch, adds variable exit_status and sets to EXIT_FAILURE before goto error

Simple patch, adds variable exit_status and sets to EXIT_FAILURE before goto error
Comment 3 Albert Astals Cid 2015-03-27 21:43:58 UTC
Matt thanks for the patch i've pushed something based on yours but reversed, i.e. initialize to error and just set success just before the error: goto in case everything went well.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.