aboutsummaryrefslogtreecommitdiffstats
path: root/main/config.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-28 21:29:27 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-28 21:29:27 +0000
commitc5d5f6573a30543a73456a822df3ecff9cf97130 (patch)
tree55ff0b60e79e8cee2044c662e6efa712e8eb42b8 /main/config.c
parentcd8e20bac86a159893f98d65e82502719ec03697 (diff)
Change the way that we read include files, to accommodate for changes in GCC 4.4.
(closes issue #17472) Reported by: seandarcy Patches: config2.patch uploaded by nivan (license 1066) Tested by: nivan git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@272921 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/config.c')
-rw-r--r--main/config.c19
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';
}