about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2013-09-08 21:12:13 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2013-09-08 21:12:13 +0100
commit061e80950223501fbcb77e987a9a0dafedf6f229 (patch)
treecfe416bd6051cda64bd7aa487c02648492caa5e5 /Functions
parenta4245da9998029e27d8ab58f1fb350a499b04983 (diff)
downloadzsh-061e80950223501fbcb77e987a9a0dafedf6f229.tar.gz
zsh-061e80950223501fbcb77e987a9a0dafedf6f229.tar.xz
zsh-061e80950223501fbcb77e987a9a0dafedf6f229.zip
31711: add execute-never style for MIME function system.
Allows alien file systems to be marked as not having executable fiels
Diffstat (limited to 'Functions')
-rw-r--r--Functions/MIME/zsh-mime-handler6
1 files changed, 5 insertions, 1 deletions
diff --git a/Functions/MIME/zsh-mime-handler b/Functions/MIME/zsh-mime-handler
index 7245c20e2..24e5184fc 100644
--- a/Functions/MIME/zsh-mime-handler
+++ b/Functions/MIME/zsh-mime-handler
@@ -76,13 +76,14 @@ suffix=${suffix#*.}
 
 local handler flags no_sh no_bg arg bg_flag="&"
 integer i
-local -a exec_asis hand_nonex
+local -a exec_asis hand_nonex exec_never
 
 # Set to a list of patterns which are ignored and executed as they are,
 # despite being called for interpretation by the mime handler.
 # Defaults to executable files, which ensures that they are executed as
 # they are, even if they have a suffix.
 zsh-mime-contexts -a $suffix execute-as-is exec_asis || exec_asis=('*(*)' '*(/)')
+zsh-mime-contexts -a $suffix execute-never exec_never
 
 # Set to a list of patterns for which the handler will be used even
 # if the file doesn't exist on the disk.
@@ -125,6 +126,9 @@ fi
 for pattern in $exec_asis; do
   files=(${dirpref}${~pattern})
   if [[ -n ${files[(r)$1]} ]]; then
+    for pattern in $exec_never; do
+      [[ ${1:A} = ${~pattern} ]] && break 2
+    done
     if (( list )); then
       for (( i = 1; i <= $#; i++ )); do
 	(( i == 1 )) || print -n " "