Fixed a problem that an UNC path isn't recognized as an absolute path.

This commit is contained in:
spx 2010-04-06 17:46:17 +00:00
parent 68ec1714c1
commit 6551a62fba

View File

@ -4017,7 +4017,9 @@ LRESULT CMeterWindow::OnCopyData(WPARAM wParam, LPARAM lParam)
*/
std::wstring CMeterWindow::MakePathAbsolute(std::wstring path)
{
if (path.empty() || path.find(L':') != std::wstring::npos)
if (path.empty() ||
path.find(L":\\") != std::wstring::npos || path.find(L":/") != std::wstring::npos ||
(path.length() >= 2 && (path[0] == L'\\' || path[0] == L'/') && (path[1] == L'\\' || path[1] == L'/'))) // UNC
{
return path; // It's already absolute path (or it's empty)
}