Skip to content
This repository
Browse code

fixed: path substitution didn't work properly because we compared pat…

…hs with slash at the end and paths without which didn't match. As we're comparing substrings here we can't use CompareWithoutSlashAtEnd().
  • Loading branch information...
commit 334d12d177a43f7e6b6e78bf596ef72ac4ada033 1 parent d5d40aa
wsoltys authored December 08, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  xbmc/utils/URIUtils.cpp
2  xbmc/utils/URIUtils.cpp
@@ -371,7 +371,7 @@ CStdString URIUtils::SubstitutePath(const CStdString& strPath)
371 371
   for (CAdvancedSettings::StringMapping::iterator i = g_advancedSettings.m_pathSubstitutions.begin();
372 372
       i != g_advancedSettings.m_pathSubstitutions.end(); i++)
373 373
   {
374  
-    if (strncmp(strPath.c_str(), i->first.c_str(), i->first.size()) == 0)
  374
+    if (strncmp(strPath.c_str(), i->first.c_str(), HasSlashAtEnd(i->first.c_str()) ? i->first.size()-1 : i->first.size()) == 0)
375 375
     {
376 376
       if (strPath.size() > i->first.size())
377 377
         return URIUtils::AddFileToFolder(i->second, strPath.Mid(i->first.size()));

0 notes on commit 334d12d

Please sign in to comment.
Something went wrong with that request. Please try again.