From e625fcc2087f0333bcec5f893f5e9373b9dadfda Mon Sep 17 00:00:00 2001 From: sdottaka Date: Mon, 3 Feb 2025 08:48:17 +0900 Subject: [PATCH] Fix issue #2635: /inifile won't work with root directory --- Src/paths.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/paths.cpp b/Src/paths.cpp index 4ce246223f3..166d773267e 100644 --- a/Src/paths.cpp +++ b/Src/paths.cpp @@ -161,7 +161,7 @@ static bool IsDirName(const String& sDir) // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/findfirstfile.asp // You cannot use root directories as the lpFileName input string for FindFirstFile - with or without a trailing backslash. size_t count = 0; - if ((sDir[0] && sDir[1] == ':' && sDir[2] == '\0') || + if ((sDir[0] && sDir[1] == ':' && (sDir[2] == '\0' || (sDir[2] == '\\' && sDir[3] == '\0'))) || // \\host\share or \\host\share\ (sDir[0] == '\\' && sDir[1] == '\\' && (count = std::count(sDir.begin(), sDir.end(), ('\\'))) <= 4 &&