]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Fix bug #11183.
authorPaul Smith <psmith@gnu.org>
Mon, 13 Feb 2006 23:38:36 +0000 (23:38 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 13 Feb 2006 23:38:36 +0000 (23:38 +0000)
ChangeLog
implicit.c

index d71f4e78733c9814ad5162248d6be5e4a50bb6a1..52f7340a6ce8f519968dbc5794711dc6d6fb0d14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-13  Paul D. Smith  <psmith@gnu.org>
+
+       * implicit.c (pattern_search): Add checking for DOS pathnames to
+       the pattern rule target LASTSLASH manipulation.
+       Fixes Savannah bug #11183.
+
 2006-02-11  Paul D. Smith  <psmith@gnu.org>
 
        * (ALL FILES): Updated copyright and license notices.
index 03172f240768e1a8cb3dbb4ac288297759546c16..7b34fba69d6e4b903f2b672fe116a0e4728c7238 100644 (file)
@@ -346,17 +346,28 @@ pattern_search (struct file *file, int archive,
          /* Set CHECK_LASTSLASH if FILENAME contains a directory
             prefix and the target pattern does not contain a slash.  */
 
+          check_lastslash = 0;
+          if (lastslash)
+            {
 #ifdef VMS
-         check_lastslash = lastslash != 0
-                           && ((strchr (target, ']') == 0)
-                               && (strchr (target, ':') == 0));
+              check_lastslash = (strchr (target, ']') == 0
+                                 && strchr (target, ':') == 0);
 #else
-         check_lastslash = lastslash != 0 && strchr (target, '/') == 0;
+              check_lastslash = strchr (target, '/') == 0;
+#ifdef HAVE_DOS_PATHS
+              /* Didn't find it yet: check for DOS-type directories.  */
+              if (!check_lastslash)
+                {
+                  char *b = strrchr (target, '\\');
+                  check_lastslash = !(b ? b > lastslash
+                                      : (target[0] && target[1] == ':'));
+                }
+#endif
 #endif
+            }
          if (check_lastslash)
            {
-             /* In that case, don't include the
-                directory prefix in STEM here.  */
+             /* If so, don't include the directory prefix in STEM here.  */
              unsigned int difference = lastslash - filename + 1;
              if (difference > stemlen)
                continue;