mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 00:19:51 +00:00
Go back to std::isalnum()
It turned out that it works fine as long as it's called with a char rather than unsigned char. (But to add to the confusion, the other variant of the function in <cctype> *requires* that cast.)
This commit is contained in:
parent
19e17e9417
commit
7aa39dc451
@ -30,6 +30,7 @@
|
||||
#include <cstring>
|
||||
#include <deque>
|
||||
#include <istream>
|
||||
#include <locale>
|
||||
|
||||
#include <boost/variant/apply_visitor.hpp>
|
||||
#include <boost/variant/get.hpp>
|
||||
@ -1316,8 +1317,7 @@ bool config::is_valid_wml_tag_name(config_key_type name)
|
||||
return std::all_of(name.begin(), name.end(), [](const char& c)
|
||||
{
|
||||
// Only alphanumeric ASCII characters and underscores are allowed
|
||||
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
|
||||
(c >= '0' && c <= '9') || c == '_';
|
||||
return std::isalnum((c), std::locale::classic()) || c == '_';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user