summaryrefslogtreecommitdiff
path: root/Shell/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-26 14:57:12 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-26 14:57:12 +0200
commitdd595fe86538a5e835dedd185379a3d56236bc1f (patch)
treea287d74b5f886f7740f61b043b0145bd18c2e869 /Shell/main.cpp
parentd66fa60fcf23fa7217a065479af6b1f5a851a506 (diff)
downloadserenity-dd595fe86538a5e835dedd185379a3d56236bc1f.zip
Shell: A '>' redirection target should be truncated.
Diffstat (limited to 'Shell/main.cpp')
-rw-r--r--Shell/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Shell/main.cpp b/Shell/main.cpp
index 2015d54af9..2cba5b352d 100644
--- a/Shell/main.cpp
+++ b/Shell/main.cpp
@@ -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;