about summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@ipost.com>2021-04-18 13:58:09 -0700
committerBart Schaefer <schaefer@ipost.com>2021-04-18 13:58:09 -0700
commit82ff9f24f170eea7daa935fdaa09ab75a2f277ff (patch)
treecef3fef19fbe032466fcfbe50b7b6aa0878300a5 /Src/zsh.h
parent56ccb4a975bc87dd10bbbd6a1cfc296d6e2203b4 (diff)
downloadzsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.tar.gz
zsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.tar.xz
zsh-82ff9f24f170eea7daa935fdaa09ab75a2f277ff.zip
48560: add TYPESET_TO_UNSET option to remove initialization of parameters
Changes typeset such that ${newparam-notset} yields "notset" and
"typeset -p newparam" does not show an assignment to the parameter.  This
is similar to the default behavior of bash and ksh, with minor differences
in typeset output.

Also add tests for some POSIX incompatibilities plus minor changes for test
harness robustness.
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index d70a4017c..af9b4fb67 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1929,8 +1929,10 @@ struct tieddata {
 				   made read-only by the user               */
 #define PM_READONLY_SPECIAL (PM_SPECIAL|PM_READONLY|PM_RO_BY_DESIGN)
 #define PM_DONTIMPORT	(1<<22)	/* do not import this variable              */
+#define PM_DECLARED	(1<<22) /* explicitly named with typeset            */
 #define PM_RESTRICTED	(1<<23) /* cannot be changed in restricted mode     */
 #define PM_UNSET	(1<<24)	/* has null value                           */
+#define PM_DEFAULTED	(PM_DECLARED|PM_UNSET)
 #define PM_REMOVABLE	(1<<25)	/* special can be removed from paramtab     */
 #define PM_AUTOLOAD	(1<<26) /* autoloaded from module                   */
 #define PM_NORESTORE	(1<<27)	/* do not restore value of local special    */
@@ -2536,6 +2538,7 @@ enum {
     TRANSIENTRPROMPT,
     TRAPSASYNC,
     TYPESETSILENT,
+    TYPESETTOUNSET,
     UNSET,
     VERBOSE,
     VIMODE,