commit c0e223f0c990c8dc3600dedc94797952429cfe04
parent 58e65103e4a7a15c59e77e8824a9ffb69396bd65
Author: Jaromil <jaromil@dyne.org>
Date:   Tue, 17 Jul 2012 19:34:47 +0200
correct opening of attachments
Diffstat:
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/zlibs/filters b/src/zlibs/filters
@@ -94,7 +94,7 @@ wwwtext=w3m
 { which elinks > /dev/null } && { wwwtext=elinks }
 cat <<EOF > $MUTTDIR/mailcap
 text/html; ${wwwtext} -dump %s; nametemplate=%s.html; copiousoutput
-application/*; a=$WORKDIR/tmp/attach-$RANDOM$RANDOM && cp %s \$a && jaro open \$a
+application/*; a=${WORKDIR}/tmp && f=\`basename %s\` && rm -f \$a/\$f && cp %s \$a/\$f && jaro open \$a/\$f
 text/plain; iconv -f iso-8859-1 -t utf-8; test=charset=%{charset} \
   && test x`echo \"$charset\" | tr a-z A-Z` = xISO-8859-1; copiousoutput
 text/plain; cat %s
diff --git a/src/zlibs/helpers b/src/zlibs/helpers
@@ -95,14 +95,12 @@ editor() {
 ##############
 ## Open a File
 open_file() {
-    a=$WORKDIR/cache/attach-$RANDOM$RANDOM
-    cp ${PARAM[1]} $a
     case $OS in
 	GNU)
-	    # TODO
+	    sensible-browser ${=PARAM} &
 	    ;;
 	MAC)
-	    open -g $a
+	    open -g ${=PARAM}
 	    ;;
     esac
 }