mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-27 06:27:57 +00:00
Formerly vpath.c.~4~
This commit is contained in:
parent
9d58debbcc
commit
2fbb3407dd
1 changed files with 9 additions and 12 deletions
21
vpath.c
21
vpath.c
|
@ -147,11 +147,6 @@ construct_vpath_list (pattern, dirpath)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip over any initial colons and blanks. */
|
|
||||||
p = dirpath;
|
|
||||||
while (*p == ':' || isblank (*p))
|
|
||||||
++p;
|
|
||||||
|
|
||||||
/* Figure out the maximum number of VPATH entries and
|
/* Figure out the maximum number of VPATH entries and
|
||||||
put it in MAXELEM. We start with 2, one before the
|
put it in MAXELEM. We start with 2, one before the
|
||||||
first colon and one nil, the list terminator and
|
first colon and one nil, the list terminator and
|
||||||
|
@ -164,19 +159,17 @@ construct_vpath_list (pattern, dirpath)
|
||||||
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
||||||
maxvpath = 0;
|
maxvpath = 0;
|
||||||
|
|
||||||
elem = 0;
|
/* Skip over any initial colons and blanks. */
|
||||||
p = dirpath;
|
p = dirpath;
|
||||||
|
while (*p == ':' || isblank (*p))
|
||||||
|
++p;
|
||||||
|
|
||||||
|
elem = 0;
|
||||||
while (*p != '\0')
|
while (*p != '\0')
|
||||||
{
|
{
|
||||||
char *v;
|
char *v;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
/* Find the next entry. */
|
|
||||||
while (*p != ':' && !isblank (*p))
|
|
||||||
++p;
|
|
||||||
if (*p == '\0')
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* Find the end of this entry. */
|
/* Find the end of this entry. */
|
||||||
v = p;
|
v = p;
|
||||||
while (*p != '\0' && *p != ':' && !isblank (*p))
|
while (*p != '\0' && *p != ':' && !isblank (*p))
|
||||||
|
@ -206,6 +199,10 @@ construct_vpath_list (pattern, dirpath)
|
||||||
else
|
else
|
||||||
/* The directory does not exist. Omit from the list. */
|
/* The directory does not exist. Omit from the list. */
|
||||||
free (v);
|
free (v);
|
||||||
|
|
||||||
|
/* Skip over colons and blanks between entries. */
|
||||||
|
while (*p == ':' || isblank (*p))
|
||||||
|
++p;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elem > 0)
|
if (elem > 0)
|
||||||
|
|
Loading…
Reference in a new issue