Browse Source

BUG: fix for bug 1850 wrapping can leave out files if they are a substring of another file

Bill Hoffman 20 years ago
parent
commit
a9692f0a18
1 changed files with 5 additions and 2 deletions
  1. 5 2
      Source/cmMakefile.cxx

+ 5 - 2
Source/cmMakefile.cxx

@@ -1157,8 +1157,11 @@ cmSourceFile *cmMakefile::GetSourceFileWithOutput(const char *cname)
       {
       // is the output of the custom command match the source files name
       out = (*i)->GetCustomCommand()->GetOutput();
-      if (out.rfind(name) != out.npos &&
-          out.rfind(name) == out.size() - name.size())
+      std::string::size_type pos = out.rfind(name);
+      // If the output matches exactly
+      if (pos != out.npos &&
+          pos == out.size() - name.size() &&
+          (pos ==0 || out[pos-1] == '/'))
         {
         return *i;
         }