summary refs log tree commit diff
diff options
context:
space:
mode:
-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;