Sophie

Sophie

distrib > Mandriva > 2009.1 > i586 > media > main-release-src > by-pkgid > bd7a7c07a188224a55b35a12e7ac6b17 > files > 2

strigi-0.6.4-2mdv2009.1.src.rpm

# 
# SVN commit 949697 by vandenoever:
# 
# Fix bug 185551
# 
# Strigi now allows path that start with protocol:/* like
#  'file:///' or 'remote:/'
# 
# BUG:185551
#

--- src/streamanalyzer/analysisresult.cpp   2009/04/05 18:50:00 949696
+++ src/streamanalyzer/analysisresult.cpp   2009/04/05 18:52:14 949697
@@ -150,7 +150,15 @@
     if (pos == std::string::npos) {
         m_name = m_path;
     } else {
-        assert(pos != m_path.size()-1); // make sure there is no trailing '/'
+        if (pos == m_path.size()-1) {
+            // assert that there is no trailing '/' unless it is part of a
+            // protocol, which means the parent must be "" and the string must
+            // end in a colon followed by up to three slashes
+            assert(m_parentpath == "");
+            int i = m_path.size();
+            while (--i > 0 && m_path[i] == '/') {}
+            assert(i > 0 && m_path[i] == ':');
+        }
         m_name = m_path.substr(pos+1);
     }
     // check that the path start with the path of the parent