X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/7013dfe93a05082153f79eca6c9e5c05b54d9d50..6156a4f734b690bf2c5df67db9ddf1858eed95e8:/.config/mutt/bgrun?ds=inline diff --git a/.config/mutt/bgrun b/.config/mutt/bgrun index ad432df..37f40ad 100755 --- a/.config/mutt/bgrun +++ b/.config/mutt/bgrun @@ -83,13 +83,13 @@ guess_extension() { get_file() { local t if [ -z "$1" ]; then - t=$(mktemp -p "$PWD" tmp.XXXXXXXXXX.$(guess_extension "$MIMETYPE")) + t=$(mktemp -p "$PWD" tmp.XXXXXXXXXX$(guess_extension "$MIMETYPE")) cat > "$t" echo "$t" else - t="$(echo ${1##*/} | sed -re 's![^[:alnum:],.@%^+=_-]!_!gi')" + t="$(echo -n ${1##*/} | sed -re 's![^[:alnum:],.@%^+=_-]!_!gi')" ln "$1" "$t" 2>/dev/null || cp "$1" "$t" - echo "$t" + echo "$PWD/$t" fi }