From 347a63da0cf1c681ac97c21a107b4722abf449b2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 13 Jun 2013 18:40:36 +0100 Subject: 31465: fix basic completion and globbing uses of disabled patterns --- ChangeLog | 10 +++++++ Completion/compinit | 3 ++- Src/glob.c | 35 ------------------------- Src/pattern.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index f85626314..c495ede95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-06-13 Peter Stephenson + + * 31465: Completion/compinit, Src/glob.c, Src/pattern.c: fix + basic completion and globbing use of pattern disables. + + * 31444: Doc/Zsh/builtins.yo, Doc/Zsh/options.yo, + Doc/zmacros.yo, Src/builtin.c, Src/exec.c, Src/options.c, + Src/pattern.c, Src/zsh.h: Basic (not fully functional) code for + enable/disable -p. + 2013-06-13 Barton E. Schaefer * 31474: Makefile.in, Src/zsh.mdd: create patchlevel.h correctly diff --git a/Completion/compinit b/Completion/compinit index 7b8a34619..f9d2c574c 100644 --- a/Completion/compinit +++ b/Completion/compinit @@ -163,8 +163,9 @@ _comp_options=( typeset -g _comp_setup='local -A _comp_caller_options; _comp_caller_options=(${(kv)options[@]}); - setopt localoptions localtraps ${_comp_options[@]}; + setopt localoptions localtraps localpatterns ${_comp_options[@]}; local IFS=$'\'\ \\t\\r\\n\\0\'' + enable -p \| \~ \( \? \* \[ \< \^ \# exec start && isset(KSHGLOB) && + ((str[-1] == Quest && !zpc_disables[ZPC_KSH_QUEST]) || + (str[-1] == Star && !zpc_disables[ZPC_KSH_STAR]) || + (str[-1] == '+' && !zpc_disables[ZPC_KSH_PLUS]) || + (str[-1] == '!' && !zpc_disables[ZPC_KSH_BANG]) || + (str[-1] == '@' && !zpc_disables[ZPC_KSH_AT])))) + return 1; + break; + + case Bar: + if (!zpc_disables[ZPC_BAR]) + return 1; + break; + + case Star: + if (!zpc_disables[ZPC_STAR]) + return 1; + break; + + case Inbrack: + if (!zpc_disables[ZPC_INBRACK]) + return 1; + break; + + case Inang: + if (!zpc_disables[ZPC_INANG]) + return 1; + break; + + case Quest: + if (!zpc_disables[ZPC_QUEST]) + return 1; + break; + + case Pound: + if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH]) + return 1; + break; + + case Hat: + if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HAT]) + return 1; + break; + } + } + return 0; +} -- cgit 1.4.1