about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-10-29 17:49:14 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-10-29 17:49:14 +0000
commit1812cf10492e0dbfc9fe6e696bee0d5f2142af63 (patch)
tree9610526c4eccbf73d0fd186c9a80cd97166d62b2 /Functions
parent925f7d7a9f28be1f81f4bfc8570cbf5558e7fe40 (diff)
downloadzsh-1812cf10492e0dbfc9fe6e696bee0d5f2142af63.tar.gz
zsh-1812cf10492e0dbfc9fe6e696bee0d5f2142af63.tar.xz
zsh-1812cf10492e0dbfc9fe6e696bee0d5f2142af63.zip
Merge of users/10720: arno + pws: bad recursive argument handling and need to be safer about options.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Misc/checkmail5
1 files changed, 3 insertions, 2 deletions
diff --git a/Functions/Misc/checkmail b/Functions/Misc/checkmail
index 9cc743db4..fc987e871 100644
--- a/Functions/Misc/checkmail
+++ b/Functions/Misc/checkmail
@@ -1,7 +1,7 @@
 #! /usr/local/bin/zsh
 #
 # This autoloadable function checks the folders specified as arguments
-# for new mails.  The arguments are interpeted in exactly the same way
+# for new mails.  The arguments are interpreted in exactly the same way
 # as the mailpath special zsh parameter (see zshparam(1)).
 #
 # If no arguments are given mailpath is used.  If mailpath is empty, $MAIL
@@ -9,6 +9,7 @@
 # This function requires zsh-3.0.1 or newer.
 #
 
+emulate -L zsh
 local file message
 
 for file in "${@:-${mailpath[@]:-${MAIL:-/var/spool/mail/$LOGNAME}}}"
@@ -18,7 +19,7 @@ do
 	if [[ -d "$file" ]] then
 		file=( "$file"/**/*(.ND) )
 		if (($#file)) then
-			checkmail "${^file}\?$message"
+			checkmail ${^file}\?$message
 		fi
 	elif test -s "$file" -a -N "$file"; then  # this also sets $_ to $file
 		print -r -- "${(e)message:-You have new mail.}"