mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Shell: A '>' redirection target should be truncated.
This commit is contained in:
parent
d66fa60fcf
commit
dd595fe865
Notes:
sideshowbarker
2024-07-19 13:56:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/dd595fe8653
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ static int run_command(const String& cmd)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Redirection::FileWrite: {
|
case Redirection::FileWrite: {
|
||||||
int fd = open(redirection.path.characters(), O_WRONLY | O_CREAT, 0666);
|
int fd = open(redirection.path.characters(), O_WRONLY | O_CREAT | O_TRUNC, 0666);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
perror("open");
|
perror("open");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue