Skip to content

Commit 541ac2c

Browse files
committed
[FIX] : fix the FileName extention returned when we have a filter like '*' or ".*" #53 by @ClaudeLx
1 parent 971d201 commit 541ac2c

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,13 +1611,16 @@ namespace IGFD
16111611
// if not a collection we can replace the filter by the extention we want
16121612
if (m_SelectedFilter.collectionfilters.empty())
16131613
{
1614-
size_t lastPoint = result.find_last_of('.');
1615-
if (lastPoint != std::string::npos)
1614+
if (m_SelectedFilter.filter.find('*') == std::string::npos && result != m_SelectedFilter.filter)
16161615
{
1617-
result = result.substr(0, lastPoint);
1618-
}
1616+
size_t lastPoint = result.find_last_of('.');
1617+
if (lastPoint != std::string::npos)
1618+
{
1619+
result = result.substr(0, lastPoint);
1620+
}
16191621

1620-
result += m_SelectedFilter.filter;
1622+
result += m_SelectedFilter.filter;
1623+
}
16211624
}
16221625

16231626
return result;

0 commit comments

Comments
 (0)