diff options
author | merakor <cem@ckyln.com> | 2023-02-05 17:17:18 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2023-02-05 17:17:18 +0000 |
commit | 294fea20b110e2485aeb5e12b41b1e9e0f4af648 (patch) | |
tree | 97a98bea82c163f4d449692d13ba8cd33489ecf7 /src | |
parent | 46b2952a6d21628552f217d0904ae4f7b7a24de8 (diff) | |
download | cpt-294fea20b110e2485aeb5e12b41b1e9e0f4af648.tar.gz |
_tmp_create(): Truncate file if it exists
FossilOrigin-Name: b6658318625d91b21a8ddb20ec0300dce260374b4ac6d86e7c6f4cec113412f5
Diffstat (limited to 'src')
-rw-r--r-- | src/cpt-lib.in | 5 |
1 files changed, 2 insertions, 3 deletions
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() { |