~ubuntu-branches/ubuntu/lucid/ghostscript/lucid-updates

« back to all changes in this revision

Viewing changes to debian/patches/no-cant-refill-scanner-input-buffer-error.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2010-02-24 10:08:23 UTC
  • Revision ID: james.westby@ubuntu.com-20100224100823-uzulpb3nvwgkriw4
Tags: 8.71.dfsg.1-0ubuntu2
no-cant-refill-scanner-input-buffer-error.dpatch: Ghostscript errored out
when getting fed with the Ubuntu test page
(/usr/share/system-config-printer/testpage-a4.ps) on stdin giving a
"Can't refill scanner input buffer" error. (Upstream bugs #691137,
#690909).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## no-cant-refill-scanner-input-buffer-error.dpatch by  <till.kamppeter@gmail.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
@DPATCH@
 
8
diff -urNad ghostscript-8.71.dfsg.1~/base/seexec.c ghostscript-8.71.dfsg.1/base/seexec.c
 
9
--- ghostscript-8.71.dfsg.1~/base/seexec.c      2009-08-14 06:12:58.000000000 +0200
 
10
+++ ghostscript-8.71.dfsg.1/base/seexec.c       2010-02-24 10:02:20.295231460 +0100
 
11
@@ -165,7 +165,11 @@
 
12
            r.limit = r.ptr + ss->hex_left;
 
13
        status = s_hex_process(&r, pw, &ss->odd, 
 
14
          (ss->is_leading_space ? hex_ignore_leading_whitespace : hex_break_on_whitespace));
 
15
-        ss->is_leading_space = (status == 2);
 
16
+        if (status == 2) {
 
17
+            ss->is_leading_space = true;
 
18
+            status = 1;
 
19
+        } else
 
20
+            ss->is_leading_space = false;
 
21
        pr->ptr = r.ptr;
 
22
        ss->hex_left -= r.ptr - start;
 
23
        /*
 
24
diff -urNad ghostscript-8.71.dfsg.1~/base/sstring.c ghostscript-8.71.dfsg.1/base/sstring.c
 
25
--- ghostscript-8.71.dfsg.1~/base/sstring.c     2009-08-13 21:04:34.000000000 +0200
 
26
+++ ghostscript-8.71.dfsg.1/base/sstring.c      2010-02-24 10:02:20.295231460 +0100
 
27
@@ -355,8 +355,12 @@
 
28
 /* ------ Utilities ------ */
 
29
 
 
30
 /*
 
31
- * Convert hex data to binary.  Return 1 if we filled the string, 0 if
 
32
- * we ran out of input data before filling the string, or ERRC on error.
 
33
+ * Convert hex data to binary. 
 
34
+ * Return 1 if we filled the string,
 
35
+ *        0 if we ran out of input data before filling the string,
 
36
+ *        2 if hex_break_on_whitespace is on and we encounrered
 
37
+ *          a white space.
 
38
+ *        ERRC on error.
 
39
  * The caller must set *odd_digit to -1 before the first call;
 
40
  * after each call, if an odd number of hex digits has been read (total),
 
41
  * *odd_digit is the odd digit value, otherwise *odd_digit = -1.
 
42
diff -urNad ghostscript-8.71.dfsg.1~/psi/iscan.c ghostscript-8.71.dfsg.1/psi/iscan.c
 
43
--- ghostscript-8.71.dfsg.1~/psi/iscan.c        2009-11-11 14:52:23.000000000 +0100
 
44
+++ ghostscript-8.71.dfsg.1/psi/iscan.c 2010-02-24 10:02:20.295231460 +0100
 
45
@@ -329,9 +329,9 @@
 
46
                                               rstate, 1, cont);
 
47
            }
 
48
     }
 
49
-    /* No more data available, but no exception.  How can this be? */
 
50
-    lprintf("Can't refill scanner input buffer!");
 
51
-    return_error(e_Fatal);
 
52
+    /* No more data available, but no exception. */
 
53
+    /* A filter is consuming headers but returns nothing. */
 
54
+    return 0;
 
55
 }
 
56
 
 
57
 /*