summaryrefslogtreecommitdiffhomepage
path: root/loader/atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-22 21:38:29 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-22 21:38:29 +0100
commit8ea6924dda8d452bd870302a2c4e96f437ee5443 (patch)
treecbcbf3724a891013923266542688d278fff49c03 /loader/atlas.cpp
parent9bde31b07ada8aa5a3a2d30ffa904c38c3c0e09a (diff)
flush
Diffstat (limited to 'loader/atlas.cpp')
-rw-r--r--loader/atlas.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/loader/atlas.cpp b/loader/atlas.cpp
index acc1d069..e811e61e 100644
--- a/loader/atlas.cpp
+++ b/loader/atlas.cpp
@@ -28,7 +28,9 @@ StringView loader_::make_atlas_path(char(&buf)[FILENAME_MAX], StringView dir, St
bool loader_::check_atlas_name(StringView str) noexcept
{
- if (!str || str[0] == '.' || str[0] == '/')
+ constexpr auto first_char =
+ "_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"_s;
+ if (!str || !first_char.find(str[0]))
return false;
if (str.findAny("\\\"'\n\r\t\a\033\0|$!%{}#^*?<>&;:^"_s) || str.find("/."_s))
return false;