[htdig3-dev] pdf_parser support broken in 012499 snapshot


Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Tue, 26 Jan 1999 15:38:56 -0600 (CST)


My apologies if this has already been addressed, but in testing the
012499 snapshot of htdig, I found the pdf_parser support broken.
Here's my fix:

--- ./htdig/PDF.cc.pdfbug Sun Jan 17 15:12:05 1999
+++ ./htdig/PDF.cc Tue Jan 26 15:34:36 1999
@@ -111,13 +111,13 @@
         acroread = "acroread";
 
     // Check for existance of acroread program! (if not, return)
- struct stat stat_buf;
+ //struct stat stat_buf;
     // Check that it exists, and is a regular file.
- if ((stat(acroread, &stat_buf) == -1) || !S_ISREG(stat_buf.st_mode))
- {
- printf("PDF::parse: cannot find acroread\n");
- return;
- }
+ //if ((stat(acroread, &stat_buf) == -1) || !S_ISREG(stat_buf.st_mode))
+ // {
+ // printf("PDF::parse: cannot find acroread\n");
+ // return;
+ // }
 
     // Write the pdf contents in a temp file to give it to acroread
 
@@ -151,7 +151,12 @@
     // acroread << " -toPostScript " << pdfName << " " << tmpdir << " 2>&1";
     acroread << " " << pdfName << " " << psName << " 2>&1";
 
- system(acroread);
+ if (system(acroread))
+ {
+ printf("PDF::parse: error running pdf_parser on %s\n", url.get());
+ unlink(pdfName);
+ return;
+ }
     FILE* psFile = fopen(psName, "r");
     if (!psFile)
     {

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
htdig3-dev@htdig.org containing the single word "unsubscribe" in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Thu Feb 04 1999 - 22:24:20 PST