]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
radiant/texwindow: test .wad file extension case-insensitively on all systems, fix...
authorThomas Debesse <dev@illwieckz.net>
Fri, 22 May 2020 12:58:11 +0000 (14:58 +0200)
committerThomas Debesse <dev@illwieckz.net>
Fri, 22 May 2020 13:01:05 +0000 (15:01 +0200)
libs/os/path.h
radiant/texwindow.cpp

index a3db167cb484ad84abbff192fc9289ae3408fcc1..9cbbc2b1361c49a21b48acb82be6b95af3e69831 100644 (file)
@@ -72,6 +72,12 @@ inline bool path_equal( const char* path, const char* other ){
 #endif
 }
 
 #endif
 }
 
+/// \brief Returns true if \p path and \p other refer to the same file or directory, case insensitively.
+/// O(n)
+inline bool path_equal_i( const char* path, const char* other ){
+       return string_equal_nocase( path, other );
+}
+
 /// \brief Returns true if the first \p n bytes of \p path and \p other form paths that refer to the same file or directory.
 /// If the paths are UTF-8 encoded, [\p path, \p path + \p n) must be a complete path.
 /// O(n)
 /// \brief Returns true if the first \p n bytes of \p path and \p other form paths that refer to the same file or directory.
 /// If the paths are UTF-8 encoded, [\p path, \p path + \p n) must be a complete path.
 /// O(n)
@@ -175,6 +181,12 @@ inline bool extension_equal( const char* extension, const char* other ){
        return path_equal( extension, other );
 }
 
        return path_equal( extension, other );
 }
 
+/// \brief Returns true if \p extension is of the same type as \p other, case insensitively.
+/// O(n)
+inline bool extension_equal_i( const char* extension, const char* other ){
+       return path_equal_i( extension, other );
+}
+
 template<typename Functor>
 class MatchFileExtension
 {
 template<typename Functor>
 class MatchFileExtension
 {
index fee615cfe0fc246562715feb995e3ff343b32f8e..89336949ec01e1d6d9863deda69c162e73becf22 100644 (file)
@@ -100,7 +100,7 @@ bool string_equal_start( const char* string, StringRange start ){
 typedef std::set<CopiedString> TextureGroups;
 
 void TextureGroups_addWad( TextureGroups& groups, const char* archive ){
 typedef std::set<CopiedString> TextureGroups;
 
 void TextureGroups_addWad( TextureGroups& groups, const char* archive ){
-       if ( extension_equal( path_get_extension( archive ), "wad" ) ) {
+       if ( extension_equal_i( path_get_extension( archive ), "wad" ) ) {
 #if 1
                groups.insert( archive );
 #else
 #if 1
                groups.insert( archive );
 #else