about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-03-07 12:31:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-03-07 12:31:00 +0000
commit74c90c0ada5db4e152c62aa6febd265a4626186f (patch)
tree4a7ca2ebe84ff6028662161812bd9a51be324d6e /Src
parenta7dc5d386cb46ba7fc3fec583442d63c1cee4f75 (diff)
downloadzsh-74c90c0ada5db4e152c62aa6febd265a4626186f.tar.gz
zsh-74c90c0ada5db4e152c62aa6febd265a4626186f.tar.xz
zsh-74c90c0ada5db4e152c62aa6febd265a4626186f.zip
18325: options on by default weren't printed correctly by zsh/parameter
Diffstat (limited to 'Src')
-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 23c868598..86911c15b 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;