summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-07-14 19:12:02 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-07-14 19:12:02 (GMT)
commita9692f0a18b6304c9e5195591df1bf67eefd14e3 (patch)
treee5ef130cf367b58f3e6782c35723add7b70aaf10 /Source/cmMakefile.cxx
parent0d14b57605c62b69ddc756eff5f2dca2d6f495d7 (diff)
downloadCMake-a9692f0a18b6304c9e5195591df1bf67eefd14e3.zip
CMake-a9692f0a18b6304c9e5195591df1bf67eefd14e3.tar.gz
CMake-a9692f0a18b6304c9e5195591df1bf67eefd14e3.tar.bz2
BUG: fix for bug 1850 wrapping can leave out files if they are a substring of another file
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1bd2115..1741b06 100644
--- a/Source/cmMakefile.cxx
+++ b/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;
}