diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2010-06-28 21:42:52 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2010-06-28 21:42:52 +0000 |
commit | cbc311cd8ff1f0948a2c8f1f27e1a30ef663417e (patch) | |
tree | 3730e74d38452162834869155ead606a2cba58be /main | |
parent | 8a07dbf95ddcf1dc2bda06fd82a58a26866493df (diff) |
Merged revisions 272921-272922 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r272921 | tilghman | 2010-06-28 16:29:27 -0500 (Mon, 28 Jun 2010) | 8 lines
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
........
r272922 | tilghman | 2010-06-28 16:38:49 -0500 (Mon, 28 Jun 2010) | 2 lines
Also trim trailing blanks on #includes
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/config.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/main/config.c b/main/config.c index c8e26ed4e..24c23d6f4 100644 --- a/main/config.c +++ b/main/config.c @@ -1031,12 +1031,13 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat, if (*c) { *c = '\0'; /* Find real argument */ - c = ast_skip_blanks(c + 1); + c = ast_strip(c + 1); if (!(*c)) { c = NULL; } - } else + } else { c = NULL; + } if (!strcasecmp(cur, "include")) { do_include = 1; } else if (!strcasecmp(cur, "exec")) { @@ -1060,20 +1061,14 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat, 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++; + /* Dequote */ + 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'; } |