Commit 035c4dd3 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14425 fixup for MDEV-25312: Remove dead code

In commit cf552f58 we removed the
function os_normalize_path() and started writing file names to the
InnoDB redo log always using the same path separator, even on
Microsoft Windows.

In commit 685d958e the ability to
recover from previous log file formats was removed. Thus, the log file
can never contain the Microsoft specific path separator and the
conversion code can be removed.

Note: *.isl files may still contain Microsoft Windows path separators.
They will be replaced with standard ones in read_link_file().
parent c0439b17
......@@ -651,22 +651,12 @@ static struct
{
/* Replace absolute DATA DIRECTORY file paths with
short names relative to the backup directory. */
const char *name= strrchr(filename, '/');
#ifdef _WIN32
if (const char *last= strrchr(filename, '\\'))
if (last > name)
name= last;
#endif
if (name)
if (const char *name= strrchr(filename, '/'))
{
while (--name > filename &&
#ifdef _WIN32
*name != '\\' &&
#endif
*name != '/');
while (--name > filename && *name != '/');
if (name > filename)
filename= name + 1;
}
}
}
char *fil_path= fil_make_filepath(nullptr, {filename, strlen(filename)},
......@@ -832,21 +822,9 @@ static struct
const char *filename= name.c_str();
if (srv_operation == SRV_OPERATION_RESTORE)
{
const char* tbl_name = strrchr(filename, '/');
#ifdef _WIN32
if (const char *last = strrchr(filename, '\\'))
if (const char *tbl_name= strrchr(filename, '/'))
{
if (last > tbl_name)
tbl_name = last;
}
#endif
if (tbl_name)
{
while (--tbl_name > filename &&
#ifdef _WIN32
*tbl_name != '\\' &&
#endif
*tbl_name != '/');
while (--tbl_name > filename && *tbl_name != '/');
if (tbl_name > filename)
filename= tbl_name + 1;
}
......
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