about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-10-29 19:32:20 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-10-29 19:32:20 +0000
commit85ef41cdc801cbd80371c8d5fc11b991b29ae35e (patch)
tree7bdb2d8740d0aaa51757eab8cb4ae6a2886e4a52
parent9a4a3d183f7ceeef5fd7100869979fcc77bf5c41 (diff)
downloadzsh-85ef41cdc801cbd80371c8d5fc11b991b29ae35e.tar.gz
zsh-85ef41cdc801cbd80371c8d5fc11b991b29ae35e.tar.xz
zsh-85ef41cdc801cbd80371c8d5fc11b991b29ae35e.zip
Merge of 22743: "set - [args]" -> "set -xv [-- args]" hack and limit it to non-native emulation.
-rw-r--r--Doc/Zsh/builtins.yo4
-rw-r--r--Src/builtin.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 99b3238bd..ab12428fb 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1108,6 +1108,10 @@ positional parameters will be unset.
 If no arguments and no `tt(-)tt(-)' are given, then the names and values of
 all parameters are printed on the standard output.  If the only argument is
 `tt(PLUS())', the names of all parameters are printed.
+
+For historical reasons, `tt(set -)' is treated as `tt(set +xv)'
+and `tt(set -) var(args)' as `tt(set +xv --) var(args)' when in
+any other emulation mode than zsh's native mode.
 )
 module(setcap)(zsh/cap)
 findex(setopt)
diff --git a/Src/builtin.c b/Src/builtin.c
index 910d73f6d..2adecbe21 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -536,7 +536,7 @@ bin_set(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 
     /* Obsolescent sh compatibility: set - is the same as set +xv *
      * and set - args is the same as set +xv -- args              */
-    if (*args && **args == '-' && !args[0][1]) {
+    if (emulation != EMULATE_ZSH && *args && **args == '-' && !args[0][1]) {
 	dosetopt(VERBOSE, 0, 0);
 	dosetopt(XTRACE, 0, 0);
 	if (!args[1])