about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiExternal.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiExternal.pm')
-rw-r--r--lib/PublicInbox/LeiExternal.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiExternal.pm b/lib/PublicInbox/LeiExternal.pm
index 47791d4e..b5dd85e1 100644
--- a/lib/PublicInbox/LeiExternal.pm
+++ b/lib/PublicInbox/LeiExternal.pm
@@ -170,9 +170,14 @@ sub lei_add_external {
                 $self->fail(<<""); # TODO: did you mean "update-external?"
 --mirror destination `$location' already exists
 
+        } elsif (-d $location) {
+                index($location, "\n") >= 0 and
+                        return $self->fail("`\\n' not allowed in `$location'");
         }
         if ($location !~ m!\Ahttps?://! && !-d $location) {
                 $mirror // return $self->fail("$location not a directory");
+                index($location, "\n") >= 0 and
+                        return $self->fail("`\\n' not allowed in `$location'");
                 $mirror = ext_canonicalize($mirror);
                 require PublicInbox::LeiMirror;
                 PublicInbox::LeiMirror->start($self, $mirror => $location);