diff options
author | jkh <jkh@FreeBSD.org> | 1997-06-13 14:21:22 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-06-13 14:21:22 +0000 |
commit | ba527a824b74480c2b6d7f14f51051289518d75c (patch) | |
tree | 469ccf87e7144bb8bf905999dc6089222c419bfd /usr.sbin/sade/dmenu.c | |
parent | d86473c883be8b8bf7059b21d465728527ffe890 (diff) | |
download | FreeBSD-src-ba527a824b74480c2b6d7f14f51051289518d75c.zip FreeBSD-src-ba527a824b74480c2b6d7f14f51051289518d75c.tar.gz |
YAMF22
Diffstat (limited to 'usr.sbin/sade/dmenu.c')
-rw-r--r-- | usr.sbin/sade/dmenu.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/usr.sbin/sade/dmenu.c b/usr.sbin/sade/dmenu.c index cafcaa0..3f76977 100644 --- a/usr.sbin/sade/dmenu.c +++ b/usr.sbin/sade/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$ + * $Id: dmenu.c,v 1.32 1997/02/22 14:11:35 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -174,26 +174,42 @@ dmenuFlagCheck(dialogMenuItem *item) int dmenuVarCheck(dialogMenuItem *item) { - char *w, *cp, *cp2, *cp3, tmp[256]; + char *w; w = (char *)item->aux; if (!w) w = (char *)item->data; if (!w) return FALSE; - SAFE_STRCPY(tmp, w); - if ((cp = index(tmp, '=')) != NULL) { - *(cp++) = '\0'; - if ((cp3 = index(cp, ',')) != NULL) - *cp3 = '\0'; - cp2 = getenv(tmp); - if (cp2) - return !strcmp(cp, cp2); - else - return FALSE; + return variable_check(w); +} + +int +dmenuVarsCheck(dialogMenuItem *item) +{ + int res, init; + char *w, *cp1, *cp2; + char *copy; + + w = (char *)item->aux; + if (!w) + w = (char *)item->data; + if (!w) + return FALSE; + + copy = strdup(w); + res = TRUE; + init = FALSE; + for (cp1 = copy; cp1 != NULL;) { + init = TRUE; + cp2 = index(cp1, ','); + if (cp2 != NULL) + *cp2++ = '\0'; + res = res && variable_check(cp1); + cp1 = cp2; } - else - return (int)getenv(tmp); + free(copy); + return res && init; } int |