From a4b7a332ebfac353073e59a4883be82152d4787c Mon Sep 17 00:00:00 2001 From: marko <Unknown> Date: Thu, 18 Jan 2007 20:33:47 +0000 Subject: [PATCH] Remove the unused function mem_strdupq(). --- include/mem0mem.h | 11 ----------- include/mem0mem.ic | 35 ----------------------------------- 2 files changed, 46 deletions(-) diff --git a/include/mem0mem.h b/include/mem0mem.h index f68d45d83df..2d5fd1db6c3 100644 --- a/include/mem0mem.h +++ b/include/mem0mem.h @@ -279,17 +279,6 @@ mem_strdupl( const char* str, /* in: string to be copied */ 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. */ diff --git a/include/mem0mem.ic b/include/mem0mem.ic index 069f8de36cb..cb8fbe92cf0 100644 --- a/include/mem0mem.ic +++ b/include/mem0mem.ic @@ -589,41 +589,6 @@ mem_strdupl( 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, allocated from a memory heap. */ -- 2.30.9