Source: psutils
Version: 1.17-28
Author: Guillem Jover <guillem@debian.org>
Status: applied
Debbug: 617872
Description:
 Fix remaining 64-bit unclean code.


diff --git a/debian/patches/off_t.patch b/debian/patches/off_t.patch
index e3facc4..25ea89b 100644
--- a/debian/patches/off_t.patch
+++ b/debian/patches/off_t.patch
@@ -1,7 +1,14 @@
-Index: psutils-1.17/psutil.c
-===================================================================
---- psutils-1.17.orig/psutil.c	2010-10-17 11:15:21.033339804 -0400
-+++ psutils-1.17/psutil.c	2010-10-17 11:15:43.273340960 -0400
+---
+ psnup.c    |    2 -
+ psresize.c |    2 -
+ psspec.c   |    2 -
+ psspec.h   |    2 -
+ psutil.c   |   69 +++++++++++++++++++++++++++++++++----------------------------
+ psutil.h   |    6 ++---
+ 6 files changed, 45 insertions(+), 38 deletions(-)
+
+--- a/psutil.c
++++ b/psutil.c
 @@ -5,7 +5,10 @@
   * utilities for PS programs
   */
@@ -31,7 +38,7 @@ Index: psutils-1.17/psutil.c
  
  #define iscomment(x,y) (strncmp(x,y,strlen(y)) == 0)
  
-@@ -33,14 +40,14 @@
+@@ -33,14 +40,14 @@ extern int pageno;
  
  static char buffer[BUFSIZ];
  static long bytes = 0;
@@ -52,7 +59,7 @@ Index: psutils-1.17/psutil.c
  
  /* list of paper sizes supported */
  static Paper papersizes[] = {
-@@ -94,15 +101,15 @@
+@@ -94,15 +101,15 @@ FILE *seekable(FILE *fp)
  #if defined(WINNT)
    struct _stat fs ;
  #else
@@ -71,7 +78,7 @@ Index: psutils-1.17/psutil.c
        return (fp);
  #endif
  
-@@ -127,7 +134,7 @@
+@@ -127,7 +134,7 @@ FILE *seekable(FILE *fp)
  
    /* discard the input file, and rewind the temporary */
    (void) fclose(fp);
@@ -80,7 +87,7 @@ Index: psutils-1.17/psutil.c
      return (NULL) ;
  
    return (ft);
-@@ -137,10 +144,10 @@
+@@ -137,10 +144,10 @@ FILE *seekable(FILE *fp)
  
  /* copy input file from current position upto new position to output file,
   * ignoring the lines starting at something ignorelist points to */
@@ -94,7 +101,7 @@ Index: psutils-1.17/psutil.c
  
    if (ignorelist != NULL) {
      while (*ignorelist > 0 && *ignorelist < here)
-@@ -151,7 +158,7 @@
+@@ -151,7 +158,7 @@ static int fcopy(long upto, long *ignore
        if (!r || fgets(buffer, BUFSIZ, infile) == NULL)
  	return 0;
        ignorelist++;
@@ -103,7 +110,7 @@ Index: psutils-1.17/psutil.c
        while (*ignorelist > 0 && *ignorelist < here)
  	ignorelist++;
      }
-@@ -172,27 +179,27 @@
+@@ -172,27 +179,27 @@ static int fcopy(long upto, long *ignore
  }
  
  /* build array of pointers to start/end of pages */
@@ -138,7 +145,7 @@ Index: psutils-1.17/psutil.c
  		     message(FATAL, "out of memory\n");
  	       }
  	       pageptr[pages++] = record;
-@@ -219,7 +226,7 @@
+@@ -219,7 +226,7 @@ void scanpages(long *sizeheaders)
  	    } else if (headerpos == 0 && iscomment(comment, "Pages:"))
  	       pagescmt = record;
  	    else if (headerpos == 0 && iscomment(comment, "EndComments"))
@@ -147,7 +154,7 @@ Index: psutils-1.17/psutil.c
  	    else if (iscomment(comment, "BeginDocument") ||
  		     iscomment(comment, "BeginBinary") ||
  		     iscomment(comment, "BeginFile"))
-@@ -231,23 +238,23 @@
+@@ -231,23 +238,23 @@ void scanpages(long *sizeheaders)
  	    else if (nesting == 0 && iscomment(comment, "EndSetup"))
  	       endsetup = record;
  	    else if (nesting == 0 && iscomment(comment, "BeginProlog"))
@@ -175,7 +182,7 @@ Index: psutils-1.17/psutil.c
     if (endsetup == 0 || endsetup > pageptr[0])
        endsetup = pageptr[0];
  }
-@@ -255,7 +262,7 @@
+@@ -255,7 +262,7 @@ void scanpages(long *sizeheaders)
  /* seek a particular page */
  void seekpage(int p)
  {
@@ -184,7 +191,7 @@ Index: psutils-1.17/psutil.c
     if (fgets(buffer, BUFSIZ, infile) != NULL &&
         iscomment(buffer, "%%Page:")) {
        char *start, *end;
-@@ -332,9 +339,9 @@
+@@ -332,9 +339,9 @@ void writepage(int p)
  }
  
  /* write from start of file to end of header comments */
@@ -196,7 +203,7 @@ Index: psutils-1.17/psutil.c
     if (pagescmt) {
        if (!fcopy(pagescmt, ignore) || fgets(buffer, BUFSIZ, infile) == NULL)
  	 message(FATAL, "I/O error in header\n");
-@@ -351,7 +358,7 @@
+@@ -351,7 +358,7 @@ int writepartprolog(void)
     if (beginprocset && !fcopy(beginprocset, NULL))
        message(FATAL, "I/O error in prologue\n");
     if (endprocset)
@@ -205,7 +212,7 @@ Index: psutils-1.17/psutil.c
     writeprolog();
     return !beginprocset;
  }
-@@ -373,7 +380,7 @@
+@@ -373,7 +380,7 @@ void writesetup(void)
  /* write trailer */
  void writetrailer(void)
  {
@@ -214,10 +221,8 @@ Index: psutils-1.17/psutil.c
     while (fgets(buffer, BUFSIZ, infile) != NULL) {
        writestring(buffer);
     }
-Index: psutils-1.17/psutil.h
-===================================================================
---- psutils-1.17.orig/psutil.h	2010-10-17 11:15:21.033339804 -0400
-+++ psutils-1.17/psutil.h	2010-10-17 11:15:43.281340200 -0400
+--- a/psutil.h
++++ b/psutil.h
 @@ -4,7 +4,7 @@
   *
   * utilities for PS programs
@@ -227,7 +232,7 @@ Index: psutils-1.17/psutil.h
  #include <stdio.h>
  #include <stdlib.h>
  #include <ctype.h>
-@@ -32,13 +32,13 @@
+@@ -32,13 +32,13 @@ extern void seekpage(int p);
  extern void writepageheader(char *label, int p);
  extern void writepagesetup(void);
  extern void writepagebody(int p);
@@ -243,11 +248,9 @@ Index: psutils-1.17/psutil.h
  extern void writestring(char *s);
  
  /* These variables are imported from the client program (e.g. psbook, psnup,
-Index: psutils-1.17/psspec.c
-===================================================================
---- psutils-1.17.orig/psspec.c	2010-10-17 11:15:21.193339920 -0400
-+++ psutils-1.17/psspec.c	2010-10-17 11:15:43.301338904 -0400
-@@ -143,7 +143,7 @@
+--- a/psspec.c
++++ b/psspec.c
+@@ -143,7 +143,7 @@ void pstops(int modulo, int pps, int nob
    pstops_write(modulo, pps, nobind, specs, draw, NULL);
  }
  
@@ -256,13 +259,33 @@ Index: psutils-1.17/psspec.c
  {
     int thispg, maxpage;
     int pageindex = 0;
-Index: psutils-1.17/psspec.h
-===================================================================
---- psutils-1.17.orig/psspec.h	2010-10-17 11:15:21.117340065 -0400
-+++ psutils-1.17/psspec.h	2010-10-17 11:15:43.325339702 -0400
-@@ -29,4 +29,4 @@
+--- a/psspec.h
++++ b/psspec.h
+@@ -29,4 +29,4 @@ extern double singledimen(char *str, voi
  extern void pstops(int modulo, int pps, int nobind, PageSpec *specs,
  		   double draw);
  extern void pstops_write(int modulo, int pps, int nobind, PageSpec *specs,
 -                         double draw, long *ignorelist);
 +                         double draw, off_t *ignorelist);
+--- a/psnup.c
++++ b/psnup.c
+@@ -88,7 +88,7 @@ main(int argc, char *argv[])
+    double iwidth, iheight ;			/* input paper size */
+    double tolerance = 100000;			/* layout tolerance */
+    Paper *paper = NULL;
+-   long sizeheaders[20];			/* headers to remove */
++   off_t sizeheaders[20];			/* headers to remove */
+    int opt;
+ 
+ #ifdef DEBIAN
+--- a/psresize.c
++++ b/psresize.c
+@@ -61,7 +61,7 @@ main(int argc, char *argv[])
+    int rotate;
+    double inwidth = -1;
+    double inheight = -1;
+-   long sizeheaders[20];			/* headers to remove */
++   off_t sizeheaders[20];			/* headers to remove */
+    Paper *paper = NULL;
+    PageSpec *specs;
+    int opt;
