From e379c912ba622d04e90920f6748752b50097c1d1 Mon Sep 17 00:00:00 2001 From: Tim Retout Date: Sat, 9 Jul 2011 23:43:21 +0100 Subject: [PATCH] Apply patch 393791-sliceprint from Debian. Signed-off-by: Tim Retout --- ChangeLog | 6 ++++++ scripts/sliceprint.1 | 6 +++--- scripts/sliceprint.in | 10 ++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf59ffc..09655d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-07-09 Tim Retout + 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. diff --git a/scripts/sliceprint.1 b/scripts/sliceprint.1 index 144331b..abd45a1 100644 --- 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) diff --git a/scripts/sliceprint.in b/scripts/sliceprint.in index b56b8dd..c542a93 100644 --- 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; } } -- 2.17.1