From a1df9c5f5dcfbcdf979cd24925c56a9f806914d2 Mon Sep 17 00:00:00 2001 From: Chen Gong Date: Mon, 16 Oct 2017 23:13:22 +0800 Subject: [PATCH] fix(config): treat "@" as map key rather than list index --- src/rime/config/config_data.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rime/config/config_data.cc b/src/rime/config/config_data.cc index 8a4d8b3660..47969f5375 100644 --- a/src/rime/config/config_data.cc +++ b/src/rime/config/config_data.cc @@ -2,6 +2,8 @@ // Copyright RIME Developers // Distributed under the BSD License // +#include +#include #include #include #include @@ -87,7 +89,7 @@ bool ConfigData::SaveToFile(const string& file_name) { } bool ConfigData::IsListItemReference(const string& key) { - return !key.empty() && key[0] == '@'; + return key.length() > 1 && key[0] == '@' && std::isalnum(key[1]); } string ConfigData::FormatListIndex(size_t index) {