summaryrefslogtreecommitdiff
path: root/implicit.c
diff options
context:
space:
mode:
authorJohn Malmberg <wb8tyw@qsl.net>2014-10-07 19:23:47 -0500
committerPaul Smith <psmith@gnu.org>2014-10-20 01:31:42 -0400
commitc0380823a27f14cdc8274ad03c0dcab216d1380b (patch)
tree544dc236327c1524afa1f3680f26b03b23fc511c /implicit.c
parent1faae1d4edbe9889f000ccba1dfd77ccad1d7de9 (diff)
downloadgunmake-c0380823a27f14cdc8274ad03c0dcab216d1380b.tar.gz
Fix VMS implicit rules and UNIX paths.
This fixes VMS implicit rules and UNIX style pathname handling. It also fixes some of the VMS style pathname handling, more work there will be needed later. TODO: There are other case insensitive platforms besides VMS. We need to find out why there is extra VMS code for this. This indicates either the extra VMS code is not needed, or the case insensitive support may not be complete on the other case insensitive platforms. * default.c: Add missing definitions to default_suffix_rules[] and default_variables[]. TODO: As it is important that VMS DCL mode definitions must always be a superset of UNIX definitions, a better way of maintaining the VMS DCL mode definitions should be devised. * dir.c (downcase_inplace): Add a reentrant downcase() routine. Add future support for VMS 8.2+ _USE_STD_STAT macro which will disable a lot of VMS specific code from compiling. (dir_file_exists_p): vmsify filename only if directory name has VMS directory delimiters. (file_exists_p): Handle both VMS and UNIX directories. (file_impossible): Handle both VMS and Unix directories. Track whether a VMS format path is needed for the return value. * file.c (lookup_file): Check if vmsify is needed; handle UNIX paths. * implicit.c (pattern_search): Enable UNIX paths. * read.c (parse_file_seq): Enable UNIX paths. * remake.c (f_mtime): Fix gpath_search call for VMS paths. * rule.c (count_implicit_rule): Enable UNIX paths, Fix VMS paths. * vpath.c (selective_vpath_search): Enable UNIX paths.
Diffstat (limited to 'implicit.c')
-rw-r--r--implicit.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/implicit.c b/implicit.c
index 8e1d541..8e17ff2 100644
--- a/implicit.c
+++ b/implicit.c
@@ -266,12 +266,15 @@ pattern_search (struct file *file, int archive,
/* Set LASTSLASH to point at the last slash in FILENAME
but not counting any slash at the end. (foo/bar/ counts as
bar/ in directory foo/, not empty in directory foo/bar/.) */
+ lastslash = strrchr (filename, '/');
#ifdef VMS
- lastslash = strrchr (filename, ']');
- if (lastslash == 0)
+ if (lastslash == NULL)
+ lastslash = strrchr (filename, ']');
+ if (lastslash == NULL)
+ lastslash = strrchr (filename, '>');
+ if (lastslash == NULL)
lastslash = strrchr (filename, ':');
-#else
- lastslash = strrchr (filename, '/');
+#endif
#ifdef HAVE_DOS_PATHS
/* Handle backslashes (possibly mixed with forward slashes)
and the case of "d:file". */
@@ -283,7 +286,6 @@ pattern_search (struct file *file, int archive,
lastslash = filename + 1;
}
#endif
-#endif
if (lastslash != 0 && lastslash[1] == '\0')
lastslash = 0;
}
@@ -339,10 +341,10 @@ pattern_search (struct file *file, int archive,
if (lastslash)
{
#ifdef VMS
- check_lastslash = (strchr (target, ']') == 0
- && strchr (target, ':') == 0);
+ check_lastslash = strpbrk (target, "/]>:") == NULL;
#else
check_lastslash = strchr (target, '/') == 0;
+#endif
#ifdef HAVE_DOS_PATHS
/* Didn't find it yet: check for DOS-type directories. */
if (check_lastslash)
@@ -351,7 +353,6 @@ pattern_search (struct file *file, int archive,
check_lastslash = !(b || (target[0] && target[1] == ':'));
}
#endif
-#endif
}
if (check_lastslash)
{