summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/options.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-03-05 04:23:33 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-03-05 04:23:33 +0000
commit658745f3f042ea56852334ad9718eabb3fa7fba1 (patch)
treef41c36290e8f504135a87514892ba907ab3eca7a /src/lib/util/options.c
parent0ac68b758f7058dfe64d406c10b909b0beb89fd3 (diff)
Fix -no<option> for booleans
Fix crash when running with -log
Diffstat (limited to 'src/lib/util/options.c')
-rw-r--r--src/lib/util/options.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/util/options.c b/src/lib/util/options.c
index 3b7fcfa200d..6b08cfb505e 100644
--- a/src/lib/util/options.c
+++ b/src/lib/util/options.c
@@ -618,9 +618,16 @@ void core_options::append_entry(core_options::entry &newentry)
m_entrylist_tailptr = &newentry.m_next;
// if we have names, add them to the map
+ astring tempstr;
for (int name = 0; name < ARRAY_LENGTH(newentry.m_name); name++)
if (newentry.m_name[name])
+ {
m_entrymap.add(newentry.m_name[name], &newentry);
+
+ // for boolean options add a "no" variant as well
+ if (newentry.type() == OPTION_BOOLEAN)
+ m_entrymap.add(tempstr.cpy("no").cat(newentry.m_name[name]), &newentry);
+ }
}