[poppler] poppler/poppler: PDFDoc.cc,1.4,1.5

Albert Astals Cid aacid at freedesktop.org
Sun Aug 7 16:58:14 PDT 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv1779/poppler

Modified Files:
	PDFDoc.cc 
Log Message:
Fix EOF checking


Index: PDFDoc.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/PDFDoc.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- PDFDoc.cc	6 Aug 2005 11:58:59 -0000	1.4
+++ PDFDoc.cc	7 Aug 2005 23:58:12 -0000	1.5
@@ -189,7 +189,15 @@
     eof[i] = ch;
   }
   eof[i] = '\0';
-  if (strstr(eof, "%%EOF") == NULL)
+
+  bool found = false;
+  for (i = i - 5; i >= 0; i--) {
+    if (strncmp (&eof[i], "%%EOF", 5) == 0) {
+      found = true;
+      break;
+    }
+  }
+  if (!found)
   {
     error(-1, "Document has not the mandatory ending %%EOF");
     errCode = errDamaged;



More information about the poppler mailing list