summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2000-02-07 19:54:04 +0000
committerPaul Smith <psmith@gnu.org>2000-02-07 19:54:04 +0000
commit17f2dda0acc8f97e40819d75d99d85283d9027a1 (patch)
tree1acbaedccd271a2346a75630a27b7c83e2aa5385 /variable.c
parent90f23f1ea6e436d681db81aa80edb7a763de2b12 (diff)
downloadgunmake-17f2dda0acc8f97e40819d75d99d85283d9027a1.tar.gz
* Fix for dir.c from Andreas Schwab.filedef-cleanup-base
* Fix += target-specific variables: if your direct parent doesn't have a setting for the variable but his parent does, you'll get recursive expansion errors.
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/variable.c b/variable.c
index 58af121..5089657 100644
--- a/variable.c
+++ b/variable.c
@@ -134,12 +134,17 @@ define_variable_in_set (name, length, value, origin, recursive, set, flocp)
/* Lookup a variable whose name is a string starting at NAME
and with LENGTH chars. NAME need not be null-terminated.
Returns address of the `struct variable' containing all info
- on the variable, or nil if no such variable is defined. */
+ on the variable, or nil if no such variable is defined.
+
+ If LISTP is not nil, return a pointer to the setlist where
+ the variable was found. If the variable wasn't found, the
+ value of LISTP is unchanged. */
struct variable *
-lookup_variable (name, length)
+lookup_variable_setlist (name, length, listp)
char *name;
unsigned int length;
+ struct variable_set_list **listp;
{
register struct variable_set_list *setlist;
@@ -160,7 +165,11 @@ lookup_variable (name, length)
if (*v->name == *name
&& strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == 0)
- return v;
+ {
+ if (listp)
+ *listp = setlist;
+ return v;
+ }
}
#ifdef VMS
@@ -181,6 +190,9 @@ lookup_variable (name, length)
sptr = value;
scnt = 0;
+ if (listp)
+ *listp = current_variable_set_list;
+
while ((sptr = strchr (sptr, '$')))
{
scnt++;