summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlofi <lofi@FreeBSD.org>2005-08-02 20:19:25 +0000
committerlofi <lofi@FreeBSD.org>2005-08-02 20:19:25 +0000
commit260b6276b20d83c04ed65a25ca22c0c2deeff3a4 (patch)
tree378bcc1a5148a768d8d862572f67ef6b6329e230
parent3c602405aaa409f9ac1879528834a25ad6504e52 (diff)
downloadFreeBSD-ports-260b6276b20d83c04ed65a25ca22c0c2deeff3a4.zip
FreeBSD-ports-260b6276b20d83c04ed65a25ca22c0c2deeff3a4.tar.gz
Fix a regression in kpdf that prevents it from opening a great number
of PDF files. Approved by: portmgr (krion)
-rw-r--r--graphics/kdegraphics3/Makefile1
-rw-r--r--graphics/kdegraphics3/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc34
-rw-r--r--graphics/kdegraphics4/Makefile1
-rw-r--r--graphics/kdegraphics4/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc34
4 files changed, 70 insertions, 0 deletions
diff --git a/graphics/kdegraphics3/Makefile b/graphics/kdegraphics3/Makefile
index 4b49bf3..40fd674 100644
--- a/graphics/kdegraphics3/Makefile
+++ b/graphics/kdegraphics3/Makefile
@@ -8,6 +8,7 @@
PORTNAME= kdegraphics
PORTVERSION= ${KDE_VERSION}
+PORTREVISION= 1
CATEGORIES= graphics kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
diff --git a/graphics/kdegraphics3/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc b/graphics/kdegraphics3/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc
new file mode 100644
index 0000000..23167b5
--- /dev/null
+++ b/graphics/kdegraphics3/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc
@@ -0,0 +1,34 @@
+--- kpdf/xpdf/xpdf/PDFDoc.cc.orig Tue Aug 2 19:37:37 2005
++++ kpdf/xpdf/xpdf/PDFDoc.cc Tue Aug 2 19:43:32 2005
+@@ -115,24 +115,20 @@
+ GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
+ str->reset();
+
+- char eof[8];
++ char *eof = new char[1025];
+ int pos = str->getPos();
+- str->setPos(7, -1);
+- eof[0] = str->getChar();
+- eof[1] = str->getChar();
+- eof[2] = str->getChar();
+- eof[3] = str->getChar();
+- eof[4] = str->getChar();
+- eof[5] = str->getChar();
+- eof[6] = str->getChar();
+- eof[7] = '\0';
++ str->setPos(1024, -1);
++ for (int i = 0; i < 1024; i++) eof[i] = str->getChar();
++ eof[1024] = '\0';
+ if (strstr(eof, "%%EOF") == NULL)
+ {
+ error(-1, "Document does not have ending %%EOF");
+ errCode = errDamaged;
++ delete[] eof;
+ return gFalse;
+ }
+-
++ delete[] eof;
++
+ str->setPos(pos);
+
+ // check header
diff --git a/graphics/kdegraphics4/Makefile b/graphics/kdegraphics4/Makefile
index 4b49bf3..40fd674 100644
--- a/graphics/kdegraphics4/Makefile
+++ b/graphics/kdegraphics4/Makefile
@@ -8,6 +8,7 @@
PORTNAME= kdegraphics
PORTVERSION= ${KDE_VERSION}
+PORTREVISION= 1
CATEGORIES= graphics kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTVERSION:S/.0//}/src
diff --git a/graphics/kdegraphics4/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc b/graphics/kdegraphics4/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc
new file mode 100644
index 0000000..23167b5
--- /dev/null
+++ b/graphics/kdegraphics4/files/patch-kpdf_xpdf_xpdf-PDFDOC.cc
@@ -0,0 +1,34 @@
+--- kpdf/xpdf/xpdf/PDFDoc.cc.orig Tue Aug 2 19:37:37 2005
++++ kpdf/xpdf/xpdf/PDFDoc.cc Tue Aug 2 19:43:32 2005
+@@ -115,24 +115,20 @@
+ GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
+ str->reset();
+
+- char eof[8];
++ char *eof = new char[1025];
+ int pos = str->getPos();
+- str->setPos(7, -1);
+- eof[0] = str->getChar();
+- eof[1] = str->getChar();
+- eof[2] = str->getChar();
+- eof[3] = str->getChar();
+- eof[4] = str->getChar();
+- eof[5] = str->getChar();
+- eof[6] = str->getChar();
+- eof[7] = '\0';
++ str->setPos(1024, -1);
++ for (int i = 0; i < 1024; i++) eof[i] = str->getChar();
++ eof[1024] = '\0';
+ if (strstr(eof, "%%EOF") == NULL)
+ {
+ error(-1, "Document does not have ending %%EOF");
+ errCode = errDamaged;
++ delete[] eof;
+ return gFalse;
+ }
+-
++ delete[] eof;
++
+ str->setPos(pos);
+
+ // check header
OpenPOWER on IntegriCloud