diff options
Diffstat (limited to 'mysys/string.c')
-rw-r--r-- | mysys/string.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mysys/string.c b/mysys/string.c index 0cf8f939260..1263e7824f9 100644 --- a/mysys/string.c +++ b/mysys/string.c @@ -176,18 +176,19 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) } my_bool dynstr_append_quoted(DYNAMIC_STRING *str, - const char *append, size_t len) + const char *append, size_t len, + char quote) { uint additional= (str->alloc_increment ? str->alloc_increment : 10); uint lim= additional; uint i; if (dynstr_realloc(str, len + additional + 2)) return TRUE; - str->str[str->length++]= '"'; + str->str[str->length++]= quote; for (i= 0; i < len; i++) { register char c= append[i]; - if (c == '"' || c == '\\') + if (c == quote || c == '\\') { if (!lim) { @@ -200,10 +201,11 @@ my_bool dynstr_append_quoted(DYNAMIC_STRING *str, } str->str[str->length++]= c; } - str->str[str->length++]= '"'; + str->str[str->length++]= quote; return FALSE; } + void dynstr_free(DYNAMIC_STRING *str) { my_free(str->str); |