about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-03-21 17:47:33 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-03-21 17:47:33 +0100
commit7e6b1c97e617ba75b4c8fdedffa02133a8393552 (patch)
tree1f2d96454ba1aa5901329a47dbea0931f1c11f15
parent5885bbe69fdd6ac43d67bfe327ebd4aa172037b4 (diff)
downloadmblaze-7e6b1c97e617ba75b4c8fdedffa02133a8393552.tar.gz
mblaze-7e6b1c97e617ba75b4c8fdedffa02133a8393552.tar.xz
mblaze-7e6b1c97e617ba75b4c8fdedffa02133a8393552.zip
mrep/mbnc: allow only one message as argument
-rwxr-xr-xmcom14
1 files changed, 13 insertions, 1 deletions
diff --git a/mcom b/mcom
index c030b61..e2f7100 100755
--- a/mcom
+++ b/mcom
@@ -311,6 +311,12 @@ fi
 		) fi
 		;;
 	*mbnc*)
+		set -- $(mseq -- "$@")
+		if [ "$#" -ne 1 ]; then
+			printf 'mbnc: needs exactly one mail to bounce\n' 1>&2
+			exit 1
+		fi
+
 		{
 			printf '%s' "$hdrs" | mhdr -M -h resent-to /dev/stdin |
 				commajoin | sed 's/^/Resent-To: /'
@@ -324,10 +330,16 @@ fi
 		printf 'Resent-Date: %s\n' "$(mdate)"
 		(
 			IFS=$NL
-			cat $(mseq "${@:-.}")
+			cat $(mseq -- "$@")
 		)
 		;;
 	*mrep*)
+		set -- $(mseq -- "$@")
+		if [ "$#" -ne 1 ]; then
+			printf 'mrep: needs exactly one mail to reply to\n' 1>&2
+			exit 1
+		fi
+
 		ng=$(mhdr -h newsgroups "$1")
 		if [ "$ng" ]; then
 			printf 'Newsgroups: %s\n' "$ng"