ls only when failed to open file

This commit is contained in:
folkert van heusden 2024-05-09 17:24:52 +02:00
parent 2c8fdb4d04
commit cb2c23939c
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -155,8 +155,6 @@ void ls_l(console *const cnsl)
std::optional<std::string> select_host_file(console *const cnsl)
{
for(;;) {
ls_l(cnsl);
cnsl->flush_input();
std::string selected_file = cnsl->read_line("Enter filename (or empty to abort): ");
@ -183,6 +181,8 @@ std::optional<std::string> select_host_file(console *const cnsl)
return selected_file;
cnsl->put_string_lf("open failed");
ls_l(cnsl);
}
}