From 8831a187362bb9fd4e0f4c34e808868adf90fe56 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 17 Sep 2006 15:33:36 +0000 Subject: Allow putting newlines into quoted values in the config using \n. I'm coming to a use for this. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5272 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/configreader.cpp b/src/configreader.cpp index 293cf9964..30e966b94 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -904,6 +904,8 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o if (conf.get(real_character)) { ServerInstance->Log(DEBUG,"Escaping %c", real_character); + if (real_character == 'n') + real_character = '\n'; line += real_character; continue; } @@ -1068,7 +1070,10 @@ bool ServerConfig::ParseLine(ConfigDataHash &target, std::string &line, long lin if ((*c == '\\') && (in_quote)) { c++; - current_value += *c; + if (*c == 'n') + current_value += '\n'; + else + current_value += *c; continue; } if (*c == '"') -- cgit v1.2.3