mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
Userland: env: Add -i
/ --ignore-environment
arg to clear env
This commit is contained in:
parent
5a307836c1
commit
7a512c4cc4
Notes:
sideshowbarker
2024-07-19 01:25:29 +09:00
Author: https://github.com/bcoles
Commit: 7a512c4cc4
Pull-request: https://github.com/SerenityOS/serenity/pull/4064
1 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,12 @@ int main(int argc, char** argv)
|
|||
const char* filename = nullptr;
|
||||
|
||||
for (int idx = 1; idx < argc; ++idx) {
|
||||
if (idx == 1) {
|
||||
if (StringView { argv[idx] } == "-i" || StringView { argv[idx] } == "--ignore-environment") {
|
||||
*environ = NULL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (StringView { argv[idx] }.contains('=')) {
|
||||
putenv(argv[idx]);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue