* Fix for dir.c from Andreas Schwab.

* 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.
This commit is contained in:
Paul Smith
2000-02-07 19:54:04 +00:00
parent 90f23f1ea6
commit 17f2dda0ac
5 changed files with 98 additions and 20 deletions

View File

@@ -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++;