[cig-commits] r9042 - cs/benchmark/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Mon Jan 14 21:28:12 PST 2008


Author: luis
Date: 2008-01-14 21:28:12 -0800 (Mon, 14 Jan 2008)
New Revision: 9042

Modified:
   cs/benchmark/cigma/trunk/src/StringUtils.cpp
Log:
Fix case where path components do not contain a slash character

Modified: cs/benchmark/cigma/trunk/src/StringUtils.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/StringUtils.cpp	2008-01-15 05:28:11 UTC (rev 9041)
+++ cs/benchmark/cigma/trunk/src/StringUtils.cpp	2008-01-15 05:28:12 UTC (rev 9042)
@@ -93,7 +93,8 @@
     std::string::size_type lastDot = filepath.find_last_of(".");
     std::string::size_type lastSep = filepath.find_last_of("/");
 
-    if ((lastDot != std::string::npos) && (lastSep < lastDot))
+    if ((lastDot != std::string::npos) &&
+        ((lastSep == std::string::npos) || (lastSep < lastDot)))
     {
         root = filepath.substr(0, lastDot);
         ext = filepath.substr(lastDot);



More information about the cig-commits mailing list