Skip to content
Snippets Groups Projects
Commit ec7ed170 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Fixed parse of cmd string

Before this fix, using cmd() with an erroneous string was triggering
no error. Now this is fixed.

Notice that this is an old bug (introduced in 0a46f15d).
It should be harmless when using MD codes with proper interfaces.
parent 8f021775
No related branches found
No related tags found
No related merge requests found
...@@ -171,7 +171,10 @@ void PlumedMain::cmd(const std::string & word,void*val){ ...@@ -171,7 +171,10 @@ void PlumedMain::cmd(const std::string & word,void*val){
std::vector<std::string> words=Tools::getWords(word); std::vector<std::string> words=Tools::getWords(word);
unsigned nw=words.size(); unsigned nw=words.size();
if(nw==1) { if(nw==1) {
switch(word_map[word]) { int iword=-1;
std::map<std::string, int>::const_iterator it=word_map.find(word);
if(it!=word_map.end()) iword=it->second;
switch(iword) {
double d; double d;
case SETBOX: case SETBOX:
CHECK_INIT(initialized,word); CHECK_INIT(initialized,word);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment