2
## 03_libpaper_support.dpatch by Masayuki Hatta <mhatta@debian.org>
4
## All lines beginning with \`## DP:' are a description of the patch.
5
## DP: Adds libpaper support
8
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
12
-patch) patch -f --no-backup-if-mismatch --dry-run -p1 < $0 && patch -f --no-backup-if-mismatch -p1 < $0
14
-unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
16
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
22
diff -ur gs/lib/gs_init.ps ghostscript-8.61.dfsg.1~svn8187/lib/gs_init.ps
23
--- gs/lib/gs_init.ps 2007-12-03 19:48:52.000000000 +0100
24
+++ ghostscript-8.61.dfsg.1~svn8187/lib/gs_init.ps 2007-12-03 19:43:05.000000000 +0100
26
% devices that default to letter or A4 can be changed by setting
28
% /DEFAULTPAPERSIZE (a4) def
29
+% Debian: Libpaper's default is in DEFPAPERSIZE; use that if the
30
+% current device is not "cups".
31
+currentdict /DEFPAPERSIZE known
32
+currentdict /DEVICE known { DEVICE } { () } ifelse
34
+ { DEFPAPERSIZE /PAPERSIZE where { pop pop } { /PAPERSIZE exch def } ifelse }
37
% Turn on array packing for the rest of initialization.
39
diff -ur gs/src/imainarg.c ghostscript-8.61.dfsg.1~svn8187/src/imainarg.c
40
--- gs/src/imainarg.c 2007-12-03 19:48:32.000000000 +0100
41
+++ ghostscript-8.61.dfsg.1~svn8187/src/imainarg.c 2007-12-03 19:43:05.000000000 +0100
47
+ /* Change by Torsten Landschoff <torsten@debian.org>:
48
+ * If no papersize is given on the commandline we want gs to use the
49
+ * default papersize of the system. This change differs from the old
50
+ * Debian change in that it does not use arg_push_string and therefore
51
+ * is not using up the nesting depth.
52
+ * -- Thu, 30 Mar 2000 21:28:25 +0200
54
+ * Applied to GPL/AFPL GhostScript by Masayuki Hatta
55
+ * -- Wed Mar 24 15:00:00 JST 2004 */
59
+ const char *paper = systempapername();
60
+ static char paperswitch[15+40+1] = "";
61
+ /* strlen("-sDEFPAPERSIZE") + 40 + space for '\0' */
63
+ if (paper != NULL && *paperswitch == '\0') {
64
+ strncat(paperswitch, "-sDEFPAPERSIZE=", 15);
65
+ strncat(paperswitch, paper, 40);
66
+ swproc(minst, paperswitch, &args);
67
+ /* args is not modified since a "-s" argument does not need
68
+ * such special handling */
71
while ((arg = arg_next(&args, &code)) != 0) {