Commit a4b7a332 authored by marko's avatar marko

Remove the unused function mem_strdupq().

parent 32a562e1
...@@ -279,17 +279,6 @@ mem_strdupl( ...@@ -279,17 +279,6 @@ mem_strdupl(
const char* str, /* in: string to be copied */ const char* str, /* in: string to be copied */
ulint len); /* in: length of str, in bytes */ ulint len); /* in: length of str, in bytes */
/**************************************************************************
Makes a NUL-terminated quoted copy of a NUL-terminated string. */
UNIV_INLINE
char*
mem_strdupq(
/*========*/
/* out, own: a quoted copy of the string,
must be deallocated with mem_free */
const char* str, /* in: string to be copied */
char q); /* in: quote character */
/************************************************************************** /**************************************************************************
Duplicates a NUL-terminated string, allocated from a memory heap. */ Duplicates a NUL-terminated string, allocated from a memory heap. */
......
...@@ -589,41 +589,6 @@ mem_strdupl( ...@@ -589,41 +589,6 @@ mem_strdupl(
return(memcpy(s, str, len)); return(memcpy(s, str, len));
} }
/**************************************************************************
Makes a NUL-terminated quoted copy of a NUL-terminated string. */
UNIV_INLINE
char*
mem_strdupq(
/*========*/
/* out, own: a quoted copy of the string,
must be deallocated with mem_free */
const char* str, /* in: string to be copied */
char q) /* in: quote character */
{
char* dst;
char* d;
const char* s = str;
size_t len = strlen(str) + 3;
/* calculate the number of quote characters in the string */
while((s = strchr(s, q)) != NULL) {
s++;
len++;
}
/* allocate the quoted string, and copy it */
d = dst = mem_alloc(len);
*d++ = q;
s = str;
while(*s) {
if ((*d++ = *s++) == q) {
*d++ = q;
}
}
*d++ = q;
*d++ = '\0';
ut_ad((ssize_t) len == d - dst);
return(dst);
}
/************************************************************************** /**************************************************************************
Makes a NUL-terminated copy of a nonterminated string, Makes a NUL-terminated copy of a nonterminated string,
allocated from a memory heap. */ allocated from a memory heap. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment