Apply patch 393791-sliceprint from Debian. - enscript - GNU Enscript
 (HTM) git clone git://thinkerwim.org/enscript.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit e379c912ba622d04e90920f6748752b50097c1d1
 (DIR) parent 38d5193ad60577bddb3218f0c5d54798a48a6458
 (HTM) Author: Tim Retout <diocles@gnu.org>
       Date:   Sat,  9 Jul 2011 23:43:21 +0100
       
       Apply patch 393791-sliceprint from Debian.
       
       Signed-off-by: Tim Retout <diocles@gnu.org>
       
       Diffstat:
         M ChangeLog                           |       6 ++++++
         M scripts/sliceprint.1                |       6 +++---
         M scripts/sliceprint.in               |      10 ++++++----
       
       3 files changed, 15 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/ChangeLog b/ChangeLog
       @@ -1,5 +1,11 @@
        2011-07-09  Tim Retout  <diocles@gnu.org>
        
       +        Apply patch 393791-sliceprint from Debian:
       +        * scripts/sliceprint.1: Complete documentation.
       +        * scripts/sliceprint.in: Force C locale.
       +        Use more liberal regexp when parsing wrapped lines message.
       +        Add missing space from before args. Savannah bug #31259.
       +
                * Makefile.am (SUBDIRS): Move intl to be built before compat.
        
                * states/Makefile.am: Use $(datadir) instead of $(prefix)/share.
 (DIR) diff --git a/scripts/sliceprint.1 b/scripts/sliceprint.1
       @@ -23,12 +23,12 @@
        sliceprint \- slice documents with long lines.
        
        .SH SYNOPSIS
       -.B sliceprint \f1[\f2enscript_options\f1]\f3 \f1[\f2files\f1]\f3
       +.B sliceprint \f1[\-o\f2file\f1]\f3 \f1[\f2enscript_options\f1]\f3 \f1[\f2files\f1]\f3
        
        .SH DESCRIPTION
        
       -XXX
       -
       +\f3Sliceprint\f1 is a wrapper around the \f3enscript(1)\f1\ \-\-slice option.
       +Output slices are written to \f2file\f1.1, \f2file\f1.2 and so on.
        
        .SH SEE ALSO
        enscript(1)
 (DIR) diff --git a/scripts/sliceprint.in b/scripts/sliceprint.in
       @@ -25,12 +25,13 @@
        #
        
        $enscript = "enscript";
       +$ENV{LC_ALL} = "C"; # we parse enscript's output
        
        $program = $0;
        $program =~ s/.*\///g;
        
        sub usage {
       -    warn "Usage: $program [ENSCRIPT_OPTION]... [FILE]...\n";
       +    warn "Usage: $program [-oFILE] [ENSCRIPT_OPTION]... [FILE]...\n";
        }
        
        # Handle arguments.
       @@ -65,14 +66,15 @@ $slice = 0;
        while (1) {
            $slice++;
            if (defined($output_file)) {
       -        $cmd = "$enscript" . $args . " --slice=$slice -p"
       +        $cmd = "$enscript " . $args . " --slice=$slice -p"
                    . $output_file . "." . $slice . " " . $files;
            } else {
       -        $cmd = "$enscript" . $args . " --slice=$slice" . $files;
       +        $cmd = "$enscript " . $args . " --slice=$slice" . $files;
            }
            print "printing slice $slice...\n";
            $result = `$cmd 2>&1`;
       -    if ($result !~ ".*lines were.*") {
       +    print $result;
       +    if ($result !~ ".*line.* were wrapped.*") {
                last;
            }
        }