=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/var.c,v retrieving revision 1.35 retrieving revision 1.36 diff -c -r1.35 -r1.36 *** src/usr.bin/make/var.c 2000/06/23 16:20:01 1.35 --- src/usr.bin/make/var.c 2000/06/23 16:21:44 1.36 *************** *** 1,4 **** ! /* $OpenBSD: var.c,v 1.35 2000/06/23 16:20:01 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: var.c,v 1.36 2000/06/23 16:21:44 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* *************** *** 70,76 **** #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else ! static char rcsid[] = "$OpenBSD: var.c,v 1.35 2000/06/23 16:20:01 espie Exp $"; #endif #endif /* not lint */ --- 70,76 ---- #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else ! static char rcsid[] = "$OpenBSD: var.c,v 1.36 2000/06/23 16:21:44 espie Exp $"; #endif #endif /* not lint */ *************** *** 385,391 **** * look for it in VAR_CMD, VAR_GLOBAL and the environment, in that order, * depending on the FIND_* flags in 'flags' */ ! var = Lst_Find(ctxt, VarCmp, name); if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD)) var = Lst_Find(VAR_CMD, VarCmp, name); --- 385,394 ---- * look for it in VAR_CMD, VAR_GLOBAL and the environment, in that order, * depending on the FIND_* flags in 'flags' */ ! if (ctxt != NULL) ! var = Lst_Find(ctxt, VarCmp, name); ! else ! var = NULL; if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD)) var = Lst_Find(VAR_CMD, VarCmp, name); *************** *** 1541,1547 **** if (v == NULL) { *lengthPtr = 2; ! if ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL)) { /* * If substituting a local variable in a non-local context, * assume it's for dynamic source stuff. We have to handle --- 1544,1550 ---- if (v == NULL) { *lengthPtr = 2; ! if (ctxt == VAR_CMD || ctxt == VAR_GLOBAL || ctxt == NULL) { /* * If substituting a local variable in a non-local context, * assume it's for dynamic source stuff. We have to handle *************** *** 1600,1607 **** *tstr = '\0'; v = VarFind (str + 2, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); ! if ((v == NULL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) && ! ((tstr-str) == 4) && (str[3] == 'F' || str[3] == 'D')) { /* * Check for bogus D and F forms of local variables since we're --- 1603,1611 ---- *tstr = '\0'; v = VarFind (str + 2, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); ! if (v == NULL && ctxt != VAR_CMD && ctxt != VAR_GLOBAL && ! ctxt != NULL && ! (tstr-str) == 4 && (str[3] == 'F' || str[3] == 'D')) { /* * Check for bogus D and F forms of local variables since we're *************** *** 1653,1662 **** } if (v == NULL) { ! if ((((tstr-str) == 3) || ! ((((tstr-str) == 4) && (str[3] == 'F' || str[3] == 'D')))) && ! ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL))) { /* * If substituting a local variable in a non-local context, --- 1657,1666 ---- } if (v == NULL) { ! if ((tstr-str == 3 || ! ((tstr-str == 4 && (str[3] == 'F' || str[3] == 'D')))) && ! (ctxt == VAR_CMD || ctxt == VAR_GLOBAL || ctxt == NULL)) { /* * If substituting a local variable in a non-local context, *************** *** 1677,1683 **** } } else if (((tstr-str) > 4) && (str[2] == '.') && isupper((unsigned char) str[3]) && ! ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL))) { int len; --- 1681,1687 ---- } } else if (((tstr-str) > 4) && (str[2] == '.') && isupper((unsigned char) str[3]) && ! (ctxt == VAR_CMD || ctxt == VAR_GLOBAL || ctxt == NULL)) { int len;