about summary refs log tree commit diff
path: root/Src/Modules/parameter.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-03-07 12:31:44 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-03-07 12:31:44 +0000
commit1c9ac56c43527819d80bc15a53460802cd7c84cd (patch)
tree2101b3d8e54d2bff98c471d51fae23e3f180e879 /Src/Modules/parameter.c
parent79d0de7c3ad8626d507b50176a80cf7ecb6f3996 (diff)
downloadzsh-1c9ac56c43527819d80bc15a53460802cd7c84cd.tar.gz
zsh-1c9ac56c43527819d80bc15a53460802cd7c84cd.tar.xz
zsh-1c9ac56c43527819d80bc15a53460802cd7c84cd.zip
18325: options on by default weren't printed correctly by zsh/parameter
Diffstat (limited to 'Src/Modules/parameter.c')
-rw-r--r--Src/Modules/parameter.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index 34a418623..6e19a377e 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -794,7 +794,14 @@ getpmoption(HashTable ht, char *name)
     pm->level = 0;
 
     if ((n = optlookup(name)))
-	pm->u.str = dupstring(opts[n] ? "on" : "off");
+    {
+	int ison;
+	if (n > 0)
+	    ison = opts[n];
+	else
+	    ison = !opts[-n];
+	pm->u.str = dupstring(ison ? "on" : "off");
+    }
     else {
 	pm->u.str = dupstring("");
 	pm->flags |= PM_UNSET;