From b694f85461e789f98cff5a65fd32176da3e3e1ab Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 29 Jan 2018 23:08:48 +0000 Subject: [PATCH] Remove quotes from config values if found. --- Conf.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Conf.cpp b/Conf.cpp index dd12307..5afec64 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -273,7 +273,14 @@ bool CConf::read() char* value = ::strtok(NULL, "\r\n"); if (value == NULL) continue; - + + // Remove quotes from the value + size_t len = ::strlen(value); + if (len > 1U && *value == '"' && value[len - 1U] == '"') { + value[len - 1U] = '\0'; + value++; + } + if (section == SECTION_GENERAL) { if (::strcmp(key, "Callsign") == 0) { // Convert the callsign to upper case