about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiLsExternal.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiLsExternal.pm')
-rw-r--r--lib/PublicInbox/LeiLsExternal.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiLsExternal.pm b/lib/PublicInbox/LeiLsExternal.pm
index dd2eb2e7..2cdd0c4d 100644
--- a/lib/PublicInbox/LeiLsExternal.pm
+++ b/lib/PublicInbox/LeiLsExternal.pm
@@ -5,6 +5,7 @@
 package PublicInbox::LeiLsExternal;
 use strict;
 use v5.10.1;
+use PublicInbox::Config qw(glob2re);
 
 # TODO: does this need JSON output?
 sub lei_ls_external {
@@ -12,7 +13,8 @@ sub lei_ls_external {
         my $do_glob = !$lei->{opt}->{globoff}; # glob by default
         my ($OFS, $ORS) = $lei->{opt}->{z} ? ("\0", "\0\0") : (" ", "\n");
         $filter //= '*';
-        my $re = $do_glob ? $lei->glob2re($filter) : undef;
+        my $re = $do_glob ? glob2re($filter) : undef;
+        $re .= '/?\\z' if defined $re;
         $re //= index($filter, '/') < 0 ?
                         qr!/\Q$filter\E/?\z! : # exact basename match
                         qr/\Q$filter\E/; # grep -F semantics