From 294fea20b110e2485aeb5e12b41b1e9e0f4af648 Mon Sep 17 00:00:00 2001 From: merakor Date: Sun, 5 Feb 2023 17:17:18 +0000 Subject: _tmp_create(): Truncate file if it exists FossilOrigin-Name: b6658318625d91b21a8ddb20ec0300dce260374b4ac6d86e7c6f4cec113412f5 --- src/cpt-lib.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/cpt-lib.in b/src/cpt-lib.in index 8b6cd13..9166374 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -2323,9 +2323,8 @@ _tmp_create() { # Create given file to the temporary directory and return its name create_tmp _ret=$(_tmp_name "$1") - # False positive, we are not reading from the file. - # shellcheck disable=2094 - out "$_ret" 3>> "$_ret" + :> "$_ret" || return 1 + out "$_ret" } create_tmp() { -- cgit v1.2.3