mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
Shell: Allow a command sequence to be delimited by newlines
This commit is contained in:
parent
639c1a1737
commit
034be8e74c
Notes:
sideshowbarker
2024-07-19 05:08:52 +09:00
Author: https://github.com/alimpfard
Commit: 034be8e74c
Pull-request: https://github.com/SerenityOS/serenity/pull/2542
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
3 changed files with 26 additions and 10 deletions
|
@ -497,12 +497,8 @@ bool Shell::run_file(const String& filename)
|
|||
return false;
|
||||
}
|
||||
auto file = file_result.value();
|
||||
for (;;) {
|
||||
auto line = file->read_line(4096);
|
||||
if (line.is_null())
|
||||
break;
|
||||
run_command(String::copy(line, Chomp));
|
||||
}
|
||||
auto data = file->read_all();
|
||||
run_command(data);
|
||||
return true;
|
||||
}
|
||||
void Shell::take_back_stdin()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue