Commit 05a716a7 authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

InnoDB: Replace ut_strdup() with mem_strdup()

parent ce471412
...@@ -129,16 +129,6 @@ ut_str_catenate( ...@@ -129,16 +129,6 @@ ut_str_catenate(
char* str1, /* in: null-terminated string */ char* str1, /* in: null-terminated string */
char* str2); /* in: null-terminated string */ char* str2); /* in: null-terminated string */
/**************************************************************************
Return a copy of the given string. The returned string must be freed
using mem_free. */
char*
ut_strdup(
/*======*/
/* out, own: cnull-terminated string */
char* str); /* in: null-terminated string */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "ut0mem.ic" #include "ut0mem.ic"
#endif #endif
......
...@@ -2314,18 +2314,18 @@ os_file_dirname( ...@@ -2314,18 +2314,18 @@ os_file_dirname(
if (last_slash < 0) { if (last_slash < 0) {
/* no slash in the path, return "." */ /* no slash in the path, return "." */
return(ut_strdup((char*)".")); return(mem_strdup("."));
} }
/* ok, there is a slash */ /* ok, there is a slash */
if (last_slash == 0) { if (last_slash == 0) {
/* last slash is the first char of the path */ /* last slash is the first char of the path */
return(ut_strdup((char*)"/")); return(mem_strdup("/"));
} }
/* non-trivial directory component */ /* non-trivial directory component */
dir = ut_strdup(path); dir = mem_strdup(path);
dir[last_slash] = 0; dir[last_slash] = 0;
return(dir); return(dir);
......
...@@ -299,27 +299,3 @@ ut_str_catenate( ...@@ -299,27 +299,3 @@ ut_str_catenate(
return(str); return(str);
} }
/**************************************************************************
Return a copy of the given string. The returned string must be freed
using mem_free. */
char*
ut_strdup(
/*======*/
/* out, own: cnull-terminated string */
char* str) /* in: null-terminated string */
{
ulint len;
char* copy;
len = ut_strlen(str);
copy = mem_alloc(len + 1);
ut_memcpy(copy, str, len);
copy[len] = 0;
return(copy);
}
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