diff -r 9e53becd92ce -r fe8091ee9501 run-mailcap
--- a/run-mailcap       Fri Jun 19 20:24:03 2009 -0400
+++ b/run-mailcap       Fri Jun 19 20:29:17 2009 -0400
@@ -438,6 +438,18 @@
             ($comm) = ($match =~ m/\Q$action\E=(.*?)\s*($|;)/);
         }
         next if (!$comm || $comm =~ m!(^|/)false$!i);
+
+        if ($action ne 'print' && $match =~ m/;\s*needsterminal\s*($|;)/ && ! 
-t STDOUT) {
+            if ($ENV{DISPLAY}) {
+                $comm = "$xtermprgrm -T '$file ($type)' -e $0 --action=$action 
'${type}:%s'";
+            } else {
+                print STDERR " - no terminal available for rule 
(needsterminal)\n" if $debug;
+                $fail++;
+                next;
+            }
+        } elsif ($action eq 'view' && $match =~ m/;\s*copiousoutput\s*($|;)/ 
&& $type ne 'text/plain') {
+            $comm .= " | $0 --action=$action text/plain:-";
+        }
         print STDERR " - program to execute: $comm\n" if $debug;
 
         if ($match =~ m/;\s*test=(.*?)\s*($|;)/) {
@@ -453,18 +465,6 @@
         }
 
         my($tmpfile,$tmplink);
-        if ($action ne 'print' && $match =~ m/;\s*needsterminal\s*($|;)/ && ! 
-t STDOUT) {
-            if ($ENV{DISPLAY}) {
-                $comm = "$xtermprgrm -T '$file ($type)' -e $0 --action=$action 
'${type}:%s'";
-            } else {
-                print STDERR " - no terminal available for rule 
(needsterminal)\n" if $debug;
-                $fail++;
-                next;
-            }
-        } elsif ($action eq 'view' && $match =~ m/;\s*copiousoutput\s*($|;)/ 
&& $type ne 'text/plain') {
-            $comm .= " | $0 --action=$action text/plain:-";
-        }
-
         if ($file ne "-") {
             if ($comm =~ m/[^%]%s/) {
                 if ($file =~ m![^ a-z0-9,.:/@%^+=_-]!i) {



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to