#!/bin/sh -e
## 03_stdin.dpatch by Andrew Stribblehill <ads@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/wompom/ads/debian/9menu/9menu-1.7/9menu.1 9menu-1.7/9menu.1
--- /home/wompom/ads/debian/9menu/9menu-1.7/9menu.1	2003-07-01 12:02:32.000000000 +0100
+++ 9menu-1.7/9menu.1	2003-09-02 12:01:52.000000000 +0100
@@ -99,7 +99,7 @@
 in addition to any other command line arguments.  This is intended for use
 with
 .B #!
-in scripts.
+in scripts. If the filename is "-" read from stdin.
 .TP
 .BI \-fg " foreground-color"
 Set the foreground color to
diff -urNad /home/wompom/ads/debian/9menu/9menu-1.7/9menu.c 9menu-1.7/9menu.c
--- /home/wompom/ads/debian/9menu/9menu-1.7/9menu.c	2003-07-01 12:02:32.000000000 +0100
+++ 9menu-1.7/9menu.c	2003-09-02 11:56:19.000000000 +0100
@@ -258,7 +258,11 @@
 		char fbuf[1024];
 		FILE *fp;
 
-		fp = fopen(filename, "r");
+                if (strcmp(filename, "-") == 0) {
+                        fp = stdin;
+                } else {
+                        fp = fopen(filename, "r");
+                }
 		if (fp == NULL) {
 			fprintf(stderr, "%s: couldn't open '%s'\n", progname,
 				filename);
