mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-08 07:09:21 +00:00
Fix core subsystem logic and safety bugs @Sirus20x6
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user