summaryrefslogtreecommitdiff
path: root/implicit.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1997-04-07 07:21:16 +0000
committerPaul Smith <psmith@gnu.org>1997-04-07 07:21:16 +0000
commit0ada207e2dca2b69a65ce186e625e7f6397edd34 (patch)
treedc117c22dc40a3d94b4ba2c5acc71ac8e53582a9 /implicit.c
parent7bb7ba784904b414b1f5f604414d232871f77a69 (diff)
downloadgunmake-0ada207e2dca2b69a65ce186e625e7f6397edd34.tar.gz
Changes for make 3.75.1
Diffstat (limited to 'implicit.c')
-rw-r--r--implicit.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/implicit.c b/implicit.c
index 2ccf354..430a440 100644
--- a/implicit.c
+++ b/implicit.c
@@ -152,7 +152,7 @@ pattern_search (file, archive, depth, recursions)
register struct rule *rule;
register struct dep *dep;
- char *p;
+ char *p, *vp;
#ifndef NO_ARCHIVES
if (archive || ar_name (filename))
@@ -167,6 +167,17 @@ pattern_search (file, archive, depth, recursions)
lastslash = rindex (filename, ']');
#else
lastslash = rindex (filename, '/');
+#ifdef __MSDOS__
+ /* Handle backslashes (possibly mixed with forward slashes)
+ and the case of "d:file". */
+ {
+ char *bslash = rindex (filename, '\\');
+ if (lastslash == 0 || bslash > lastslash)
+ lastslash = bslash;
+ if (lastslash == 0 && filename[0] && filename[1] == ':')
+ lastslash = filename + 1;
+ }
+#endif
#endif
if (lastslash != 0 && lastslash[1] == '\0')
lastslash = 0;
@@ -388,10 +399,12 @@ pattern_search (file, archive, depth, recursions)
}
/* This code, given FILENAME = "lib/foo.o", dependency name
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
- if (vpath_search (&p, (time_t *) 0))
+ vp = p;
+ if (vpath_search (&vp, (time_t *) 0))
{
- DEBUGP2 ("Found dependency as `%s'.%s\n", p, "");
- found_files[deps_found++] = p;
+ DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp);
+ strcpy(vp, p);
+ found_files[deps_found++] = vp;
continue;
}
@@ -554,7 +567,7 @@ pattern_search (file, archive, depth, recursions)
dep->next = file->deps;
file->deps = dep;
}
-
+
if (!checked_lastslash[foundrule])
/* Always allocate new storage, since STEM might be
on the stack for an intermediate file. */