diff options
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sql/log.cc b/sql/log.cc index e9aa273676a..af03cecd462 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -448,13 +448,10 @@ const char *MYSQL_LOG::generate_name(const char *log_name, { if (!log_name || !log_name[0]) { - /* - TODO: The following should be using fn_format(); We just need to - first change fn_format() to cut the file name if it's too long. - */ - strmake(buff, pidfile_name,FN_REFLEN-5); - strmov(fn_ext(buff),suffix); - return (const char *)buff; + strmake(buff, pidfile_name, FN_REFLEN - strlen(suffix) - 1); + return (const char *) + fn_format(buff, buff, "", suffix, MYF(MY_REPLACE_EXT|MY_REPLACE_DIR)); + } // get rid of extension if the log is binary to avoid problems if (strip_ext) |