Skip to content

Commit d331d13

Browse files
committed
[FIX] : fix the path returned by GetCurrentPath when the current path is empty (by ex if you select a drive letter on windows) discussed [here](Akshat-max-dev@65cba8c#commitcomment-49102176). thanks to @Akshat-max-dev
1 parent 1ce9cea commit d331d13

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,9 +1598,11 @@ namespace IGFD
15981598
if (dlg_filters.empty()) // if directory mode
15991599
{
16001600
std::string selectedDirectory = FileNameBuffer;
1601-
if (!selectedDirectory.empty() &&
1602-
selectedDirectory != ".")
1603-
path += PATH_SEP + selectedDirectory;
1601+
if (!selectedDirectory.empty() && selectedDirectory != ".")
1602+
if (path.empty())
1603+
path = selectedDirectory;
1604+
else
1605+
path += PATH_SEP + selectedDirectory;
16041606
}
16051607

16061608
return path;

0 commit comments

Comments
 (0)