Fix core subsystem logic and safety bugs @Sirus20x6

This commit is contained in:
Jari Sundell
2026-04-17 18:54:46 +02:00
committed by GitHub
parent 4235507292
commit 1adcf230d2
10 changed files with 43 additions and 23 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ std::string
remove_newlines(const std::string& str) {
std::string result;
for (auto& itr : str) {
if (itr != '\n' || itr != '\n')
if (itr != '\n' && itr != '\r')
result.push_back(itr);
}
return result;
+3 -1
View File
@@ -20,7 +20,9 @@ Directory::is_valid() const {
return false;
DIR* d = opendir(expand_path(m_path).c_str());
closedir(d);
if (d != NULL)
closedir(d);
return d;
}
+6 -5
View File
@@ -124,12 +124,13 @@ ListFocus<Base>::dec_focus() {
template <typename Base>
typename ListFocus<Base>::iterator
ListFocus<Base>::erase(iterator itr) {
if (itr == m_focus)
return m_focus = m_base->erase(itr);
else
return m_base->erase(itr);
if (itr == m_focus) {
m_focus = m_base->erase(itr);
emit_changed();
return m_focus;
}
emit_changed();
return m_base->erase(itr);
}
template <typename Base>