mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:25:07 +00:00
Shell: A '>' redirection target should be truncated.
This commit is contained in:
parent
d66fa60fcf
commit
dd595fe865
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ static int run_command(const String& cmd)
|
|||
break;
|
||||
}
|
||||
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) {
|
||||
perror("open");
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue