summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2022-11-22 13:50:55 +0100
committerThomas Voss <mail@thomasvoss.com> 2022-11-22 13:50:55 +0100
commit18f4dffbe83c987e9644c01dd2dd312dbfad02c1 (patch)
tree54d7b070270de791f335aa7cc8615becca800d8e
parentff14faea7e2b9be2cd1b15d8c86f80e0d5ff5461 (diff)
Don't fail when a file has no extension
-rwxr-xr-xdoasedit2
1 files changed, 1 insertions, 1 deletions
diff --git a/doasedit b/doasedit
index add6525..6786e43 100755
--- a/doasedit
+++ b/doasedit
@@ -43,7 +43,7 @@ PROG=${0##*/}
[ -L "$1" ] && die 2 "$1: File is a symbolic link, refusing to edit."
[ ! -r "$1" ] && die 3 "$1: File cannot be read by the current user."
-tmp=$(mktemp --tmpdir doasedit.XXXXXXXX --suffix="${1//*./.}") || \
+tmp=$(mktemp --tmpdir doasedit.XXXXXXXX --suffix="${1//\//-}") || \
die 4 "Could not create temporary file."
trap "rm -f $tmp" EXIT HUP INT TERM
cp "$1" "$tmp" || die 5 "$1: Unable to copy file."