mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
Userland: Add pledge to less
This commit is contained in:
parent
4ac8d9c2ac
commit
6386c2d880
Notes:
sideshowbarker
2024-07-18 10:09:22 +09:00
Author: https://github.com/doctor-rd 🔰 Commit: https://github.com/SerenityOS/serenity/commit/6386c2d8805 Pull-request: https://github.com/SerenityOS/serenity/pull/8533
@ -306,6 +306,11 @@ static void cat_file(FILE* file)
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio rpath tty", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
char const* filename = "-";
|
||||
char const* prompt = "?f%f :.(line %l)?e (END):.";
|
||||
bool dont_switch_buffer = false;
|
||||
@ -330,6 +335,11 @@ int main(int argc, char** argv)
|
||||
file = fopen(filename, "r");
|
||||
}
|
||||
|
||||
if (pledge("stdio tty", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (emulate_more) {
|
||||
// Configure options that match more's behavior
|
||||
dont_switch_buffer = true;
|
||||
|
Loading…
Reference in New Issue
Block a user