Skip to content

Commit

Permalink
Fix crash while renaming a new empty untitled (not dirty) tab
Browse files Browse the repository at this point in the history
  • Loading branch information
donho committed Sep 24, 2024
1 parent ff6215a commit 7032885
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PowerEditor/src/NppIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,9 @@ bool Notepad_plus::fileRename(BufferID id)
if (isSnapshotMode)
{
std::wstring oldBackUpFileName = buf->getBackupFileName();
if (oldBackUpFileName.empty())
return success;

std::wstring newBackUpFileName = oldBackUpFileName;

size_t index = newBackUpFileName.find_last_of(oldFileNamePath) - oldFileNamePath.length() + 1;
Expand Down

0 comments on commit 7032885

Please sign in to comment.