X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/7013dfe93a05082153f79eca6c9e5c05b54d9d50..05d4f8015b5da9be04da4c76909fdfd7575b4f35:/.config/mutt/bgrun 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 }