Skip to content

Commit

Permalink
JXDocumentManager: fix for edge case where file was on disk, but no l…
Browse files Browse the repository at this point in the history
…onger
  • Loading branch information
jafl committed Jun 9, 2024
1 parent d6a9296 commit 6fb3333
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libjx/code/JXDocumentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ JXDocumentManager::UpdateDocumentMenu
const JString& n2 = i == count ? JString::empty : itsDocList->GetItem(i+1).doc->GetName();
if (n2 != n1)
{
new_name:
if (firstIndex > 0)
{
for (JIndex j=firstIndex; j<=i; j++)
Expand All @@ -701,6 +702,10 @@ JXDocumentManager::UpdateDocumentMenu
const JString* s1 = nameList.GetItem(i);
const JString* s2 = nameList.GetItem(i+1);
JSize ml = JString::CalcCharacterMatchLength(*s1, *s2);
if (ml == 0)
{
goto new_name;
}

JStringIterator iter(*s1, JStringIterator::kStartAfterChar, ml);
JUtf8Character c;
Expand Down

0 comments on commit 6fb3333

Please sign in to comment.