summaryrefslogtreecommitdiff
path: root/mysys/string.c
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2012-12-23 20:57:54 +0200
committerunknown <sanja@askmonty.org>2012-12-23 20:57:54 +0200
commit40ae63dd65fb9e812f29d3520acb0ba6b64d3005 (patch)
treea11cd4a7bc7660d1d2159497469f32e4f8d177f4 /mysys/string.c
parent28c9e1a550bc9f2c2dbb28304d22552ea944cf07 (diff)
downloadmariadb-git-40ae63dd65fb9e812f29d3520acb0ba6b64d3005.tar.gz
backport to 5.5 dyncol changes and names support
Diffstat (limited to 'mysys/string.c')
-rw-r--r--mysys/string.c10
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);