X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/7013dfe93a05082153f79eca6c9e5c05b54d9d50..5dadf1577fe7fc5950a1527ffc40f4ea8e94d280:/.config/mutt/bgrun?ds=sidebyside 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 }