Skip to content

Commit 92124cb

Browse files
Minor: Prefer $TMPDIR if set; use /tmp as fallback
Co-authored-by: Edwin Kofler <[email protected]>
1 parent 6598e46 commit 92124cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

todo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sed() {
3636
elif [ "$1" = '-i.bak' ]; then
3737
shift
3838
filepath=${!#}
39-
filepath_temp=/tmp/todo.sh-sed.$RANDOM.$$
39+
filepath_temp=${TMPDIR-/tmp}/todo.sh-sed.$RANDOM.$$
4040
command sed "$@" > "$filepath_temp" && mv "$filepath_temp" "$filepath"
4141
else
4242
command sed "$@"

0 commit comments

Comments
 (0)