gzip/zmore.diff

45 lines
856 B
Diff

---
zmore.in | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
Index: gzip-1.12/zmore.in
===================================================================
--- gzip-1.12.orig/zmore.in
+++ gzip-1.12/zmore.in
@@ -38,6 +38,29 @@ case $1 in
exit 1;;
esac
+opt=
+pager ()
+{
+ eval ${PAGER-more} \$opt
+ cat > /dev/null
+}
+
+while :; do
+ case $1 in
+ --)
+ shift
+ break
+ ;;
+ [-+]*)
+ opt="$opt $1"
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
if test $# = 0; then
if test -t 0; then
printf >&2 '%s\n' "$0: missing operands; try '$0 --help' for help"
@@ -51,4 +74,4 @@ do
test $# -lt 2 ||
printf '::::::::::::::\n%s\n::::::::::::::\n' "$FILE" || break
'gzip' -cdfq -- "$FILE"
-done 2>&1 | eval ${PAGER-more}
+done 2>&1 | pager