Commit d74a0457 authored by knielsen@mysql.com's avatar knielsen@mysql.com

Merge mysql.com:/usr/local/mysql/mysql-5.0-bug20622

into  mysql.com:/usr/local/mysql/tmp-5.0
parents 40a1c179 98a5cdfe
...@@ -72,7 +72,9 @@ uint dirname_part(my_string to, const char *name) ...@@ -72,7 +72,9 @@ uint dirname_part(my_string to, const char *name)
SYNPOSIS SYNPOSIS
convert_dirname() convert_dirname()
to Store result here to Store result here. Must be at least of size
min(FN_REFLEN, strlen(from) + 1) to make room
for adding FN_LIBCHAR at the end.
from Original filename from Original filename
from_end Pointer at end of filename (normally end \0) from_end Pointer at end of filename (normally end \0)
......
...@@ -391,8 +391,13 @@ int Instance_options::complete_initialization(const char *default_path, ...@@ -391,8 +391,13 @@ int Instance_options::complete_initialization(const char *default_path,
const char *tmp; const char *tmp;
char *end; char *end;
if (!mysqld_path && !(mysqld_path= strdup_root(&alloc, default_path))) if (!mysqld_path)
goto err; {
// Need one extra byte, as convert_dirname() adds a slash at the end.
if (!(mysqld_path= alloc_root(&alloc, strlen(default_path) + 2)))
goto err;
strcpy((char *)mysqld_path, default_path);
}
// it's safe to cast this to char* since this is a buffer we are allocating // it's safe to cast this to char* since this is a buffer we are allocating
end= convert_dirname((char*)mysqld_path, mysqld_path, NullS); end= convert_dirname((char*)mysqld_path, mysqld_path, NullS);
......
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