forked from Bananymous/banan-os
Shell: Don't crash if history file does not exist :D
This commit is contained in:
parent
41e2b898ab
commit
91381546d5
|
@ -707,7 +707,7 @@ Input::Input()
|
||||||
|
|
||||||
FILE* history_fp = fopen(s_history_path.data(), "r");
|
FILE* history_fp = fopen(s_history_path.data(), "r");
|
||||||
if (history_fp == nullptr)
|
if (history_fp == nullptr)
|
||||||
return;
|
goto history_initialized;
|
||||||
|
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
BAN::String current_line;
|
BAN::String current_line;
|
||||||
|
@ -733,6 +733,7 @@ Input::Input()
|
||||||
s_history.remove(0);
|
s_history.remove(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
history_initialized:
|
||||||
|
|
||||||
m_buffers = s_history;
|
m_buffers = s_history;
|
||||||
MUST(m_buffers.emplace_back(""_sv));
|
MUST(m_buffers.emplace_back(""_sv));
|
||||||
|
|
Loading…
Reference in New Issue