mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +00:00
save-buffer needs to use O_TRUNC.
This commit is contained in:
parent
acef311fe3
commit
73c5a487c1
1 changed files with 1 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||
if (fd != -1)
|
||||
f = fdopen(fd, "ab");
|
||||
} else {
|
||||
fd = openat(cwd, path, O_CREAT|O_RDWR, 0600);
|
||||
fd = openat(cwd, path, O_CREAT|O_RDWR|O_TRUNC, 0600);
|
||||
if (fd != -1)
|
||||
f = fdopen(fd, "wb");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue