diff -r fe8091ee9501 -r a1063b2fce1d run-mailcap
--- a/run-mailcap Fri Jun 19 20:29:17 2009 -0400
+++ b/run-mailcap Fri Jun 19 20:37:20 2009 -0400
@@ -439,7 +439,20 @@
}
next if (!$comm || $comm =~ m!(^|/)false$!i);
- if ($action ne 'print' && $match =~ m/;\s*needsterminal\s*($|;)/ && !
-t STDOUT) {
+ if ($action eq 'cat' && $match !~ m/;\s*copiousoutput\s*($|;)/) {
+ print STDERR " - not copiousoutput, needed for cat\n" if $debug;
+ $fail++;
+ next;
+ } elsif ($action eq 'view' && $match =~ m/;\s*copiousoutput\s*($|;)/) {
+ if ($type eq 'text/plain') {
+ print STDERR " - skipping text/plain copiousoutput rule for
view\n" if $debug;
+ $fail++;
+ next;
+ } else {
+ print STDERR " - copiousoutput, piping back to $0 for view\n"
if $debug;
+ $comm .= " | $0 --action=$action text/plain:-";
+ }
+ } elsif ($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 {
@@ -447,8 +460,6 @@
$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;
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]