summaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/variable.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-03-10 17:24:08 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-03-10 17:24:08 +0000
commit1a8a1188c07078ff5b76d4d69e1dc2f9f1ae8db1 (patch)
tree758350f5b98593ecfe67ec24c5baca5e5e4550e0 /usr.sbin/sysinstall/variable.c
parent94db1b81988c740f4709318667d2d1164019faa8 (diff)
Notes
Diffstat (limited to 'usr.sbin/sysinstall/variable.c')
-rw-r--r--usr.sbin/sysinstall/variable.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/sysinstall/variable.c b/usr.sbin/sysinstall/variable.c
index a13b71dd74a7..c5fcc2788827 100644
--- a/usr.sbin/sysinstall/variable.c
+++ b/usr.sbin/sysinstall/variable.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: variable.c,v 1.20 1997/06/13 14:21:22 jkh Exp $
+ * $Id: variable.c,v 1.21 1997/10/12 16:21:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -171,14 +171,18 @@ variable_get_value(char *var, char *prompt)
int
variable_check(char *data)
{
- char *w, *cp, *cp2, *cp3, tmp[256];
+ char *cp, *cp2, *cp3, tmp[256];
- w = data;
- if (!w)
+ if (!data)
return FALSE;
- SAFE_STRCPY(tmp, w);
+ SAFE_STRCPY(tmp, data);
if ((cp = index(tmp, '=')) != NULL) {
*(cp++) = '\0';
+ if (*cp == '"') { /* smash quotes if present */
+ ++cp;
+ if ((cp3 = index(cp, '"')) != NULL)
+ *cp3 = '\0';
+ }
if ((cp3 = index(cp, ',')) != NULL)
*cp3 = '\0';
cp2 = getenv(tmp);
@@ -189,5 +193,5 @@ variable_check(char *data)
return FALSE;
}
else
- return (int)getenv(tmp);
+ return getenv(tmp) ? 1 : 0;
}