#! /bin/sh /usr/share/dpatch/dpatch-run ## 46_pbmprint.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad --exclude=CVS --exclude=.svn ./filter/image-pnm.c /tmp/dpep-work.JOWiat/cupsys-1.1.23/filter/image-pnm.c --- ./filter/image-pnm.c 2005-06-13 22:22:49.000000000 +0300 +++ /tmp/dpep-work.JOWiat/cupsys-1.1.23/filter/image-pnm.c 2005-06-13 22:23:53.141494887 +0300 @@ -168,6 +168,18 @@ switch (format) { case 1 : + for (x = img->xsize, inptr = in; x > 0; x --, inptr ++) { + int c; + do { + c = fgetc(fp); + } while (c != '1' && c != '0' && c != EOF); + if (c == '1') + *inptr = 0; + else if (c == '0') + *inptr = 255; + } + break; + case 2 : for (x = img->xsize, inptr = in; x > 0; x --, inptr ++) if (fscanf(fp, "%d", &val) == 1) @@ -193,16 +205,16 @@ x --, inptr ++) { if (*outptr & bit) - *inptr = 255; - else *inptr = 0; + else + *inptr = 255; if (bit > 1) bit >>= 1; else { bit = 128; - inptr ++; + outptr ++; } } break;