diff options
author | Adam <Adam@anope.org> | 2013-05-08 10:12:31 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-08 10:12:31 -0400 |
commit | 5e7085130eb245e6ab9d44c04816ad62a324cd43 (patch) | |
tree | b873f866af15ae7e53d816ced37faefa07cab301 /src/config.cpp | |
parent | 9b07e163c0e1ceed30e72aead2338b47ef2da1b2 (diff) |
Fix reading multi line quotes from the conf with blank lines or lines with only whitespace
Diffstat (limited to 'src/config.cpp')
-rw-r--r-- | src/config.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/config.cpp b/src/config.cpp index b3eca95ff..5cddfb268 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -664,6 +664,10 @@ void Conf::LoadConf(File &file) { Anope::string line = file.Read(); ++linenumber; + + /* If this line is completely empty and we are in a quote, just append a newline */ + if (line.empty() && in_quote) + wordbuffer += "\n"; for (unsigned c = 0, len = line.length(); c < len; ++c) { @@ -673,7 +677,6 @@ void Conf::LoadConf(File &file) /* Strip leading white spaces from multi line quotes */ if (c == 0) { - wordbuffer += "\n"; while (c < len && isspace(line[c])) ++c; ch = line[c]; @@ -784,9 +787,9 @@ void Conf::LoadConf(File &file) in_word = true; } - if (ch == ';' || ch == '}' || c + 1 == len) + if (ch == ';' || ch == '}' || c + 1 >= len) { - bool eol = c + 1 == len; + bool eol = c + 1 >= len; if (!eol && in_quote) // Allow ; and } in quoted strings |