Skip to content

Commit

Permalink
allow config values to be surrounded by doublequot
Browse files Browse the repository at this point in the history
  • Loading branch information
hrkfdn committed Aug 26, 2017
1 parent 1bd559f commit cf0ee8c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cf0ee8c

Please sign in to comment.