Skip to content

Commit

Permalink
Work-around bug williamh/dotconf#1: don't trust the return value of d…
Browse files Browse the repository at this point in the history
…otconf_command_loop(), use state->error to detect whether an error occured in an included file
  • Loading branch information
sgielen committed Feb 19, 2013
1 parent 80b0e12 commit 1334913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void dazeus::ConfigReader::read() {
// Initialise global config in progress. Other fields will be
// initialised when a section is started, global starts now.
state->global_progress = new GlobalConfig();
if(dotconf_command_loop(configfile) == 0) {
if(dotconf_command_loop(configfile) == 0 || state->error.length() > 0) {
dotconf_cleanup(configfile);
if(state->error.size() == 0)
state->error = "Error reading config file.";
Expand Down

0 comments on commit 1334913

Please sign in to comment.