Fix bug #139: Unable to use TLS - due to not handling quotes around configuration strings.
Conflicts: src/util/misc.c
This commit is contained in:
@@ -483,3 +483,24 @@ int string_to_boolean(const char* str, int* boolean)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
char* strip_off_quotes(char* line)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (!*line)
|
||||
return line;
|
||||
|
||||
len = strlen(line);
|
||||
if (len < 2)
|
||||
return line;
|
||||
|
||||
if ((line[0] == '"' && line[len - 1] == '"') ||
|
||||
(line[0] == '\'' && line[len - 1] == '\''))
|
||||
{
|
||||
line[len-1] = '\0';
|
||||
return line + 1;
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user