mirror of
https://github.com/joel16/NX-Shell.git
synced 2024-11-23 03:39:49 +00:00
fs: Fix renaming files/folders destination path (fixes #116)
This commit is contained in:
parent
d07de640b3
commit
091328a840
@ -138,8 +138,9 @@ namespace FS {
|
||||
|
||||
bool Rename(FsDirectoryEntry &entry, const std::string &dest_path) {
|
||||
std::string src_path = FS::BuildPath(entry);
|
||||
std::string full_dest_path = FS::BuildPath(dest_path, true);
|
||||
|
||||
if (rename(src_path.c_str(), dest_path.c_str()) != 0) {
|
||||
if (rename(src_path.c_str(), full_dest_path.c_str()) != 0) {
|
||||
Log::Error("FS::Rename(%s, %s) failed.\n", src_path.c_str(), dest_path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
@ -84,7 +84,8 @@ namespace Popups {
|
||||
|
||||
if (ImGui::Button(strings[cfg.lang][Lang::OptionsRename], ImVec2(200, 50))) {
|
||||
std::string path = Keyboard::GetText(strings[cfg.lang][Lang::OptionsRenamePrompt], data.entries[data.selected].name);
|
||||
if (R_SUCCEEDED(FS::Rename(data.entries[data.selected], path.c_str()))) {
|
||||
|
||||
if (FS::Rename(data.entries[data.selected], path.c_str())) {
|
||||
Options::RefreshEntries(false);
|
||||
sort = -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user