diff options
author | jkh <jkh@FreeBSD.org> | 2000-02-26 12:07:40 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 2000-02-26 12:07:40 +0000 |
commit | 94de17793fe60f498f5e586d39b60275347f7db3 (patch) | |
tree | 85feaadb88fd11cccc510dc1e9028cfb6d772ff3 /usr.sbin/sysinstall | |
parent | ef07546591c6911c436e0c4cc059bb829a5e8e35 (diff) | |
download | FreeBSD-src-94de17793fe60f498f5e586d39b60275347f7db3.zip FreeBSD-src-94de17793fe60f498f5e586d39b60275347f7db3.tar.gz |
Toggle variables between YES and NO values, don't just set them to YES
or unset them. That makes it impossible to turn something off.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/dmenu.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c index 6f5f4e5..79762be 100644 --- a/usr.sbin/sysinstall/dmenu.c +++ b/usr.sbin/sysinstall/dmenu.c @@ -116,7 +116,7 @@ dmenuSetKmapVariable(dialogMenuItem *tmp) char *lang; int err; - variable_set((char *)tmp->data, 1); + variable_set((char *)tmp->data, TRUE); lang = variable_get(VAR_KEYMAP); if (lang != NULL) { @@ -133,15 +133,14 @@ int dmenuToggleVariable(dialogMenuItem *tmp) { char *var; + int status; if (!(var = (char *)tmp->data)) { msgConfirm("Incorrect data field for `%s'!", tmp->title); return DITEM_FAILURE; } - if (!variable_check(var)) - variable_set(var, *var != '_'); - else - variable_unset(var); + status = variable_check(var); + variable_set2(var, status ? "NO" : "YES", *var != '_'); return DITEM_SUCCESS; } |