diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-03-25 16:35:33 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-03-25 16:35:33 +1100 |
| commit | 435b5b7ff97c7e52d50c002c9480af7066ead2ad (patch) | |
| tree | 0e5e9bbf0443e8078a56fde1b9cd620309f048f7 /src/client_manager.cc | |
| parent | 2d85e945167bb47fac5389172f190536352df8f1 (diff) | |
Unify code that validates identifiers in Kakoune
Session/Client/User modes names are now requiered to be "identifiers"
they must be in [a-zA-Z0-9_-]. Option names are the same except they
do not allow '-' as they need to be made available through the env vars
and '-' is not supported there.
Fixes #1946
Diffstat (limited to 'src/client_manager.cc')
| -rw-r--r-- | src/client_manager.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc index ad9a5009..6d4ef641 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -174,7 +174,8 @@ void ClientManager::clear_client_trash() bool ClientManager::validate_client_name(StringView name) const { - return const_cast<ClientManager*>(this)->get_client_ifp(name) == nullptr; + return all_of(name, is_identifier) and + const_cast<ClientManager*>(this)->get_client_ifp(name) == nullptr; } Client* ClientManager::get_client_ifp(StringView name) |
