Skip to content

Commit

Permalink
Fix parsing of white-space only blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenin committed Apr 16, 2024
1 parent f4ae07f commit 6c00fea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/colvarparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ int colvarparse::check_keywords(std::string &conf, char const *key)
{
if (cvm::debug())
cvm::log("Configuration string for \""+std::string(key)+
"\": \"\n"+conf+"\".\n");
"\":\n\""+conf+"\".\n");

strip_values(conf);
// after stripping, the config string has either empty lines, or
Expand Down Expand Up @@ -833,7 +833,8 @@ bool colvarparse::key_lookup(std::string const &conf,
data_end) + 1;
}

if (data != NULL) {
// data_end < data_begin means that the data or block contains only whitespace
if (data != NULL && data_end > data_begin) {
data->append(line, data_begin, (data_end-data_begin));

if (cvm::debug()) {
Expand Down

0 comments on commit 6c00fea

Please sign in to comment.