summary refs log tree commit diff
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
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
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/parameter.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fdfe13e78..9fdae7a82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2003-03-07  Peter Stephenson  <pws@csr.com>
 
+	* 18325: Src/Modules/parameter.c: options on by default weren't
+	handled correctly.
+
 	* 18319: Philippe Troin: Src/exec.c, Src/init.c, Src/jobs.c:
 	Fix various process group problems associated with certain
 	versions of `su'.  In particular, this improves `suspend'
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;