fixup! fix: return error when renaming into existing file (#5563)

This commit is contained in:
Charles Kerr 2023-06-22 17:33:19 -05:00
parent 4343926441
commit b86afe185b
1 changed files with 2 additions and 2 deletions

View File

@ -2466,11 +2466,11 @@ bool renameArgsAreValid(tr_torrent const* tor, std::string_view oldpath, std::st
}
auto const newpath_as_dir = tr_pathbuf{ newpath, '/' };
auto const n_files = tor->file_count();
auto const n_files = tor->fileCount();
for (tr_file_index_t i = 0; i < n_files; ++i)
{
auto const& name = tor->file_subpath(i);
auto const& name = tor->fileSubpath(i);
if (newpath == name || tr_strvStartsWith(name, newpath_as_dir))
{
return false;