Commit a9692f0a authored by Bill Hoffman's avatar Bill Hoffman
Browse files

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

parent 0d14b576
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment