diff options
author | monty@mysql.com <> | 2004-03-25 23:29:45 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2004-03-25 23:29:45 +0200 |
commit | e0e0314d606399778f595d33a191c248f15cb4c2 (patch) | |
tree | 7815fb40163d1db39e3991dcd19341ef57d08d74 /mysys/default.c | |
parent | 3b34a6a2dd73792e1b79047a491bd02b30d5ec68 (diff) | |
parent | 488fe61074a83ff31e6ac2f609ba596f903f4d4d (diff) | |
download | mariadb-git-e0e0314d606399778f595d33a191c248f15cb4c2.tar.gz |
Merge with 4.0
Diffstat (limited to 'mysys/default.c')
-rw-r--r-- | mysys/default.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mysys/default.c b/mysys/default.c index a01ed4dd39f..d09b0dd97af 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -450,23 +450,25 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, static char *remove_end_comment(char *ptr) { - char quote= 0; + char quote= 0; /* we are inside quote marks */ + char escape= 0; /* symbol is protected by escape chagacter */ for (; *ptr; ptr++) { - if (*ptr == '\'' || *ptr == '\"') + if ((*ptr == '\'' || *ptr == '\"') && !escape) { if (!quote) quote= *ptr; else if (quote == *ptr) quote= 0; } - /* We are not inside a comment */ + /* We are not inside a string */ if (!quote && *ptr == '#') { *ptr= 0; return ptr; } + escape= (quote && *ptr == '\\' && !escape); } return ptr; } |