From: Tilghman Lesher Date: Mon, 28 Jun 2010 21:29:27 +0000 (+0000) Subject: Change the way that we read include files, to accommodate for changes in GCC 4.4. X-Git-Tag: 1.4.34-rc1~2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0abc6a359645b7897a683b22ea8749572440949;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@272921 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/config.c b/main/config.c index 7d2af29c65..4a7bad894a 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'; }