O_TRUNC is needed in case file exists.

pull/2573/head
nicm 2021-02-11 09:03:38 +00:00
parent e40831a002
commit 79e1984962
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'a'))
flags = O_APPEND;
else
flags = 0;
flags = O_TRUNC;
file_write(cmdq_get_client(item), path, flags, bufdata, bufsize,
cmd_save_buffer_done, item);
free(path);