Skip to content

Commit

Permalink
Fix issue WinMerge#2635: /inifile won't work with root directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Feb 2, 2025
1 parent b6ccd01 commit e625fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit e625fcc

Please sign in to comment.