aboutsummaryrefslogtreecommitdiffstats
path: root/print/psutils/files/patch-psresize.c
diff options
context:
space:
mode:
Diffstat (limited to 'print/psutils/files/patch-psresize.c')
-rw-r--r--print/psutils/files/patch-psresize.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/print/psutils/files/patch-psresize.c b/print/psutils/files/patch-psresize.c
new file mode 100644
index 000000000000..7c7eeb37f248
--- /dev/null
+++ b/print/psutils/files/patch-psresize.c
@@ -0,0 +1,56 @@
+--- psresize.c.orig 1997-03-12 07:53:03.000000000 +0900
++++ psresize.c 2012-03-03 03:02:24.000000000 +0900
+@@ -20,6 +20,10 @@
+ #include "pserror.h"
+ #include "patchlev.h"
+
++#if defined(LIBPAPER)
++#include <paper.h>
++#endif
++
+ char *program ;
+ int pages ;
+ int verbose ;
+@@ -46,7 +50,7 @@
+ #define MIN(x,y) ((x) > (y) ? (y) : (x))
+ #define MAX(x,y) ((x) > (y) ? (x) : (y))
+
+-void main(int argc, char *argv[])
++int main(int argc, char *argv[])
+ {
+ double scale, rscale; /* page scale */
+ double waste, rwaste; /* amount wasted */
+@@ -56,13 +60,21 @@
+ double inheight = -1;
+ Paper *paper;
+ PageSpec *specs;
++ char *name = NULL;
+
++#if defined(LIBPAPER)
++ name = (char *)systempapername();
++ if (name == NULL)
++ name = (char *)defaultpapername();
++#else
+ #ifdef PAPER
+- if ( (paper = findpaper(PAPER)) != (Paper *)0 ) {
+- inwidth = width = (double)PaperWidth(paper);
+- inheight = height = (double)PaperHeight(paper);
+- }
++ name = PAPER;
++#endif
+ #endif
++ if ((paper = findpaper(name)) != NULL) {
++ inwidth = width = (double)PaperWidth(paper);
++ inheight = height = (double)PaperHeight(paper);
++ }
+
+ vshift = hshift = 0;
+ rotate = 0;
+@@ -175,6 +187,6 @@
+
+ pstops(1, 1, 0, specs, 0.0); /* do page rearrangement */
+
+- exit(0);
++ return (0);
+ }
+