File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 10
10
#include < cmath>
11
11
12
12
#if defined (WIN32) || defined (_WIN32) || defined (__WIN32)
13
- #define OSWIN
14
- #ifndef NOMINMAX
15
- #define NOMINMAX
13
+ #define OSWIN
14
+ #ifndef NOMINMAX
15
+ #define NOMINMAX
16
16
#endif
17
17
#include " Dirent/dirent.h"
18
18
#include < windows.h>
@@ -653,9 +653,9 @@ namespace imgui_addons
653
653
654
654
bool ImGuiFileBrowser::validateFile ()
655
655
{
656
- int idx = selected_fn.find_last_of (" . " );
657
- std::string ext = selected_fn.substr (idx, selected_fn.length () - idx);
658
- return (std::find (valid_exts.begin (), valid_exts.end (), ext ) != valid_exts.end ());
656
+ int idx = selected_fn.find_last_of (' . ' );
657
+ std::string file_ext = idx == std::string::npos ? " " : selected_fn.substr (idx, selected_fn.length () - idx);
658
+ return (std::find (valid_exts.begin (), valid_exts.end (), file_ext ) != valid_exts.end ());
659
659
}
660
660
661
661
void ImGuiFileBrowser::parsePathTabs (std::string path)
You can’t perform that action at this time.
0 commit comments