diff options
Diffstat (limited to 'usr.sbin/sysinstall/dmenu.c')
-rw-r--r-- | usr.sbin/sysinstall/dmenu.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c index c806ab9..45c861e 100644 --- a/usr.sbin/sysinstall/dmenu.c +++ b/usr.sbin/sysinstall/dmenu.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: dmenu.c,v 1.33 1997/06/13 14:21:19 jkh Exp $ + * $Id: dmenu.c,v 1.34 1997/09/17 16:18:14 pst Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -138,6 +138,28 @@ dmenuToggleVariable(dialogMenuItem *tmp) } int +dmenuISetVariable(dialogMenuItem *tmp) +{ + char *ans, *var; + WINDOW *w = NULL; /* Keep lint happy */ + + if (!(var = (char *)tmp->data)) { + msgConfirm("Incorrect data field for `%s'!", tmp->title); + return DITEM_FAILURE; + } + w = savescr(); + ans = msgGetInput(variable_get(var), tmp->title); + restorescr(w); + if (!ans) + return DITEM_FAILURE; + else if (!*ans) + variable_unset(var); + else + variable_set2(var, ans); + return DITEM_SUCCESS; +} + +int dmenuSetFlag(dialogMenuItem *tmp) { if (*((unsigned int *)tmp->data) & tmp->aux) |