diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-03 15:36:13 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-03 15:36:13 +0000 |
commit | 9b23755bea7a6f621262d4681b85f5351cce7a80 (patch) | |
tree | 5b030d5befb88b1bd71ce49480cf03871e273d26 /config.c | |
parent | 0d50a68e0cb952264d08febc6a6b7ff81df50e1e (diff) |
Fix escaping ; (bug #2368)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3720 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'config.c')
-rwxr-xr-x | config.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -455,13 +455,19 @@ static int cfg_process(struct ast_config *tmp, struct ast_category **_tmpc, stru int object; /* Strip off lines using ; as comment */ c = strchr(buf, ';'); - if (c) { - *c = '\0'; + while (c) { + if ((c == buf) || (*(c-1) != '\\')) { + *c = '\0'; #ifdef PRESERVE_COMMENTS - c++; - if (*c != '!') - com = build_comment(c); + c++; + if (*c != '!') + com = build_comment(c); #endif + } else { + *(c-1) = ';'; + memmove(c, c + 1, strlen(c + 1)); + } + c = strchr(c + 1, ';'); } cur = strip(buf); if (!ast_strlen_zero(cur)) { |