mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-24 12:58:40 +00:00
Formerly file.c.~19~
This commit is contained in:
parent
953f1c7df0
commit
dba6ec5d0c
1 changed files with 29 additions and 2 deletions
31
file.c
31
file.c
|
@ -50,8 +50,20 @@ lookup_file (name)
|
|||
if (*name == '\0')
|
||||
abort ();
|
||||
|
||||
/* This is also done in parse_file_seq, so this is redundant
|
||||
for names read from makefiles. It is here for names passed
|
||||
on the command line. */
|
||||
while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
|
||||
name += 2;
|
||||
{
|
||||
name += 2;
|
||||
while (*name == '/')
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
}
|
||||
|
||||
if (*name == '\0')
|
||||
/* It was all slashes after a dot. */
|
||||
name = "./";
|
||||
|
||||
hashval = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
|
@ -79,7 +91,22 @@ enter_file (name)
|
|||
for names read from makefiles. It is here for names passed
|
||||
on the command line. */
|
||||
while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
|
||||
name += 2;
|
||||
{
|
||||
name += 2;
|
||||
while (*name == '/')
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
}
|
||||
|
||||
if (*name == '\0')
|
||||
{
|
||||
/* It was all slashes! Move back to the dot and truncate
|
||||
it after the first slash, so it becomes just "./". */
|
||||
do
|
||||
--name;
|
||||
while (name[0] != '.');
|
||||
name[2] = '\0';
|
||||
}
|
||||
|
||||
hashval = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
|
|
Loading…
Reference in a new issue