From cf0ee8c6d6660c6ff1debb3774f30e24c7c81aeb Mon Sep 17 00:00:00 2001 From: Henrik Friedrichsen Date: Sat, 26 Aug 2017 20:31:28 +0200 Subject: [PATCH] allow config values to be surrounded by doublequot --- config.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config.cpp b/config.cpp index ef22358..693dc2f 100644 --- a/config.cpp +++ b/config.cpp @@ -5,7 +5,16 @@ CConfig* Config = 0; int IniHandler(void* param, const char* section, const char* name, const char* value) { CConfig* config = (CConfig*)param; - config->Set(name, value); + std::string val = std::string(value); + + // strip quotes if they exist to allow passwords to begin with a whitespace + if(val.length() >= 2 && val.front() == '\"' && val.back() == '\"') { + val.erase(0, 1); + val.erase(val.length() - 1); + } + + config->Set(name, val); + return 1; }