mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-31 03:25:08 +00:00
Formerly read.c.~39~
This commit is contained in:
parent
f31ff1c1c4
commit
81acf8675a
1 changed files with 16 additions and 3 deletions
19
read.c
19
read.c
|
@ -1385,11 +1385,24 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||
p--;
|
||||
|
||||
if (strip)
|
||||
while (q[0] == '.' && q[1] == '/' && q[2] != '\0' && !isblank (q[2]))
|
||||
q += 2;
|
||||
{
|
||||
/* Skip leading `./'s. */
|
||||
while (p - q > 2 && q[0] == '.' && q[1] == '/')
|
||||
{
|
||||
q += 2; /* Skip "./". */
|
||||
while (q < p && *q == '/')
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++q;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extract the filename just found, and skip it. */
|
||||
name = savestring (q, p - q);
|
||||
|
||||
if (q == p)
|
||||
/* ".///" was stripped to "". */
|
||||
name = savestring ("./", 2);
|
||||
else
|
||||
name = savestring (q, p - q);
|
||||
|
||||
/* Add it to the front of the chain. */
|
||||
new1 = (struct nameseq *) xmalloc (size);
|
||||
|
|
Loading…
Reference in a new issue