mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 16:50:14 +00:00
Fix escaping ; (bug #2368)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
16
config.c
16
config.c
@@ -455,13 +455,19 @@ static int cfg_process(struct ast_config *tmp, struct ast_category **_tmpc, stru
|
|||||||
int object;
|
int object;
|
||||||
/* Strip off lines using ; as comment */
|
/* Strip off lines using ; as comment */
|
||||||
c = strchr(buf, ';');
|
c = strchr(buf, ';');
|
||||||
if (c) {
|
while (c) {
|
||||||
*c = '\0';
|
if ((c == buf) || (*(c-1) != '\\')) {
|
||||||
|
*c = '\0';
|
||||||
#ifdef PRESERVE_COMMENTS
|
#ifdef PRESERVE_COMMENTS
|
||||||
c++;
|
c++;
|
||||||
if (*c != '!')
|
if (*c != '!')
|
||||||
com = build_comment(c);
|
com = build_comment(c);
|
||||||
#endif
|
#endif
|
||||||
|
} else {
|
||||||
|
*(c-1) = ';';
|
||||||
|
memmove(c, c + 1, strlen(c + 1));
|
||||||
|
}
|
||||||
|
c = strchr(c + 1, ';');
|
||||||
}
|
}
|
||||||
cur = strip(buf);
|
cur = strip(buf);
|
||||||
if (!ast_strlen_zero(cur)) {
|
if (!ast_strlen_zero(cur)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user