]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix an issue with using UpdateConfig (manager action) where escaped semicolons
authorJason Parker <jparker@digium.com>
Mon, 6 Aug 2007 16:30:51 +0000 (16:30 +0000)
committerJason Parker <jparker@digium.com>
Mon, 6 Aug 2007 16:30:51 +0000 (16:30 +0000)
 in a config would be converted to just semicolons (\; to ;)

Issue 9938

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78180 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/config.c

index bea1cfc1ed1f74f6016a76368349776920a0d833..5e7b19c6005deb23e0355cf4260b95da1001e312 100644 (file)
@@ -862,9 +862,8 @@ static struct ast_config *config_text_file_load(const char *database, const char
                                
                                while ((comment_p = strchr(new_buf, COMMENT_META))) {
                                        if ((comment_p > new_buf) && (*(comment_p-1) == '\\')) {
-                                               /* Yuck, gotta memmove */
-                                               memmove(comment_p - 1, comment_p, strlen(comment_p) + 1);
-                                               new_buf = comment_p;
+                                               /* Escaped semicolons aren't comments. */
+                                               new_buf = comment_p + 1;
                                        } else if(comment_p[1] == COMMENT_TAG && comment_p[2] == COMMENT_TAG && (comment_p[3] != '-')) {
                                                /* Meta-Comment start detected ";--" */
                                                if (comment < MAX_NESTED_COMMENTS) {