Skip to content

Commit

Permalink
fix #20 : the sorting function was not following the strict weak orde…
Browse files Browse the repository at this point in the history
…ring relationship, in particular comp(a,a)=false

This was leading to a crash probably due to some duplicated items by the sorting algo (thanks @jceipek for pointing this)
  • Loading branch information
dfeneyrou committed Aug 18, 2021
1 parent fc53a64 commit 4e4ee16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/viewer/vwFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ vwFileDialog::draw(int fontSize)

// Sort folders
std::sort(_dirEntries.begin(), _dirEntries.end(),
[](const Entry& a, const Entry& b)->bool { return strcasecmp(a.name.toChar(), b.name.toChar())<=0; } );
[](const Entry& a, const Entry& b)->bool { return strcasecmp(a.name.toChar(), b.name.toChar())<0; } );
forceFileSorting = true;
_isEntriesDirty = false;
}
Expand Down

0 comments on commit 4e4ee16

Please sign in to comment.