diff options
Diffstat (limited to 'main/config.c')
-rw-r--r-- | main/config.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/main/config.c b/main/config.c index 7d2af29c6..4a7bad894 100644 --- a/main/config.c +++ b/main/config.c @@ -726,20 +726,13 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat, if (c) { cur = c; /* Strip off leading and trailing "'s and <>'s */ - if (*c == '"') { - /* Dequote */ - while (*c) { - if (*c == '"') { - strcpy(c, c + 1); /* SAFE */ - c--; - } else if (*c == '\\') { - strcpy(c, c + 1); /* SAFE */ - } - c++; + if ((*c == '"') || (*c == '<')) { + char quote_char = *c; + if (quote_char == '<') { + quote_char = '>'; } - } else if (*c == '<') { - /* C-style include */ - if (*(c + strlen(c) - 1) == '>') { + + if (*(c + strlen(c) - 1) == quote_char) { cur++; *(c + strlen(c) - 1) = '\0'; } |