about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiOverview.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-20 14:04:43 +0900
committerEric Wong <e@80x24.org>2021-01-21 03:29:16 +0000
commit3dde6fa1268e2f86f10f26b7d427598e582aed2a (patch)
tree91594295d071ff279bcc4d18bc3fb3dc1e9d3334 /lib/PublicInbox/LeiOverview.pm
parentb0b13249a538fc6f9a4c109d15d51170e3dd8bdd (diff)
downloadpublic-inbox-3dde6fa1268e2f86f10f26b7d427598e582aed2a.tar.gz
We may attempt to write an mbox to any terminal, block, or
character device, not just regular files and FIFOs/pipes.
The only thing that is known to not work is a directory.

Sockets may be possible with some OSes (e.g. Plan 9) or
filesystems.  This fixes t/lei.t on FreeBSD 11.x
Diffstat (limited to 'lib/PublicInbox/LeiOverview.pm')
-rw-r--r--lib/PublicInbox/LeiOverview.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm
index dcc3088b..cab2b055 100644
--- a/lib/PublicInbox/LeiOverview.pm
+++ b/lib/PublicInbox/LeiOverview.pm
@@ -42,12 +42,10 @@ sub detect_fmt ($$) {
         my ($lei, $dst) = @_;
         if ($dst =~ m!\A([:/]+://)!) {
                 $lei->fail("$1 support not implemented, yet\n");
-        } elsif (!-e $dst) {
-                'maildir'; # the default
+        } elsif (!-e $dst || -d _) {
+                'maildir'; # the default TODO: MH?
         } elsif (-f _ || -p _) {
                 $lei->fail("unable to determine mbox family of $dst\n");
-        } elsif (-d _) { # TODO: MH?
-                'maildir';
         } else {
                 $lei->fail("unable to determine format of $dst\n");
         }