summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2/Util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IcePatch2/Util.cpp')
-rw-r--r--cpp/src/IcePatch2/Util.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp
index 49da0c2edba..f2ebc03a07d 100644
--- a/cpp/src/IcePatch2/Util.cpp
+++ b/cpp/src/IcePatch2/Util.cpp
@@ -280,14 +280,16 @@ IcePatch2::getSuffix(const string& pa)
{
const string path = simplify(pa);
- string::size_type pos = path.rfind('.');
- if(pos == string::npos)
+ string::size_type dotPos = path.rfind('.');
+ string::size_type slashPos = path.rfind('/');
+
+ if(dotPos == string::npos || slashPos != string::npos && slashPos > dotPos)
{
return string();
}
else
{
- return path.substr(pos + 1);
+ return path.substr(dotPos + 1);
}
}