diff options
Diffstat (limited to 'loader/atlas.cpp')
| -rw-r--r-- | loader/atlas.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/loader/atlas.cpp b/loader/atlas.cpp index ede9f8ec..0f492119 100644 --- a/loader/atlas.cpp +++ b/loader/atlas.cpp @@ -27,6 +27,16 @@ StringView loader_::make_atlas_path(char(&buf)[FILENAME_MAX], StringView dir, St return StringView{buf}; } +bool loader_::check_atlas_name(StringView str) noexcept +{ + if (!str || str[0] == '.' || str[0] == '/') + return false; + if (str.findAny("\\\"'\n\r\t\a\033\0|$!%{}#^*?<>&;:^"_s) || str.find("/."_s)) + return false; + + return true; +} + } // namespace floormat namespace floormat::loader_detail { @@ -129,16 +139,4 @@ void loader_impl::get_anim_atlas_list() } } -bool loader_impl::check_atlas_name(StringView str) -{ - if (str.isEmpty()) - return false; - if (str.findAny("\n\r\t\0\\|$<>&;:^'\""_s) || str.find("/."_s)) - return false; - if (str[0] == '.' || str[0] == '/') - return false; - - return true; -} - } // namespace floormat::loader_detail |
