Skip to content

Commit

Permalink
fix(config): treat "@" as map key rather than list index
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Oct 16, 2017
1 parent 1177142 commit a1df9c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rime/config/config_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright RIME Developers
// Distributed under the BSD License
//
#include <cctype>
#include <cstdlib>
#include <fstream>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a1df9c5

Please sign in to comment.