Permalink
Browse files

WINSMBDirectory::GetDirectory: unify with other code and use WIN32Uti…

…l::ConvertPathToWin32Form
  • Loading branch information...
1 parent b3e6bcf commit d0e790b3df0222ff2e106f4659d89ff10a2c2606 @Karlson2k Karlson2k committed Oct 17, 2013
Showing with 5 additions and 8 deletions.
  1. +5 −8 xbmc/filesystem/windows/WINSMBDirectory.cpp
@@ -95,14 +95,11 @@ bool CWINSMBDirectory::GetDirectory(const CStdString& strPath1, CFileItemList &i
memset(&wfd, 0, sizeof(wfd));
//rebuild the URL
- std::string strUNCShare = "\\\\?\\UNC\\" + (std::string)url.GetHostName() + "\\" + URIUtils::FixSlashesAndDups(url.GetFileName(), '\\');
-
- if(!URIUtils::HasSlashAtEnd(strUNCShare))
- strUNCShare.append("\\");
-
- std::wstring strSearchMask;
- g_charsetConverter.utf8ToW(strUNCShare, strSearchMask, false, false, true);
- strSearchMask += L"*";
+ std::wstring strSearchMask(CWIN32Util::ConvertPathToWin32Form(GetLocal(strPath)));
+ if (!strSearchMask.empty() && strSearchMask[strSearchMask.length() - 1] == '\\')
+ strSearchMask += L'*';
+ else
+ strSearchMask += L"\\*";
FILETIME localTime;
CAutoPtrFind hFind ( FindFirstFileW(strSearchMask.c_str(), &wfd));

0 comments on commit d0e790b

Please sign in to comment.