mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Truncate output file before writing in picker mode
This commit is contained in:
parent
25fab4cb2e
commit
e2545f9596
|
@ -8476,7 +8476,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (g_state.picker) {
|
||||
if (selbufpos) {
|
||||
fd = selpath ? open(selpath, O_WRONLY | O_CREAT, 0600) : STDOUT_FILENO;
|
||||
fd = selpath ? open(selpath, O_WRONLY | O_CREAT | O_TRUNC, 0600) : STDOUT_FILENO;
|
||||
if ((fd == -1) || (seltofile(fd, NULL) != (size_t)(selbufpos)))
|
||||
xerror();
|
||||
|
||||
|
|
Loading…
Reference in a new issue