make extension_equal() check case insensitive in Unix
allows most of file types with non lowercase extension known issue: textures with non lowercase extension in loose folders are visible now, but they aren't loaded, because it leads to fopen( filename.lowercase_extension )
This commit is contained in:
@@ -223,7 +223,7 @@ const char* file_dialog_show( GtkWidget* parent, bool open, const char* title, c
|
||||
else{ /* validate extension */
|
||||
bool valid = false;
|
||||
for ( std::size_t i = 0; i < masks.m_filters.size(); ++i )
|
||||
if( string_length( masks.m_filters[i].c_str() ) >= 2 && string_equal_nocase( extension, masks.m_filters[i].c_str() + 2 ) )
|
||||
if( string_length( masks.m_filters[i].c_str() ) >= 2 && extension_equal( extension, masks.m_filters[i].c_str() + 2 ) )
|
||||
valid = true;
|
||||
if( !valid ){
|
||||
g_file_dialog_file[0] = '\0';
|
||||
|
||||
@@ -170,7 +170,7 @@ inline const char* path_get_extension( const char* path ){
|
||||
/// \brief Returns true if \p extension is of the same type as \p other.
|
||||
/// O(n)
|
||||
inline bool extension_equal( const char* extension, const char* other ){
|
||||
return path_equal( extension, other );
|
||||
return string_equal_nocase( extension, other );
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
|
||||
Reference in New Issue
Block a user