Skip to content

Commit a1df9c5

Browse files
committed
fix(config): treat "@" as map key rather than list index
1 parent 1177142 commit a1df9c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rime/config/config_data.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Copyright RIME Developers
33
// Distributed under the BSD License
44
//
5+
#include <cctype>
6+
#include <cstdlib>
57
#include <fstream>
68
#include <boost/algorithm/string.hpp>
79
#include <boost/filesystem.hpp>
@@ -87,7 +89,7 @@ bool ConfigData::SaveToFile(const string& file_name) {
8789
}
8890

8991
bool ConfigData::IsListItemReference(const string& key) {
90-
return !key.empty() && key[0] == '@';
92+
return key.length() > 1 && key[0] == '@' && std::isalnum(key[1]);
9193
}
9294

9395
string ConfigData::FormatListIndex(size_t index) {

0 commit comments

Comments
 (0)