]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extsearch: canonicalize topdir
authorEric Wong <e@80x24.org>
Sat, 7 Nov 2020 10:56:57 +0000 (10:56 +0000)
committerEric Wong <e@80x24.org>
Sun, 8 Nov 2020 10:18:20 +0000 (10:18 +0000)
This makes `ps' output look a bit nicer if there's trailing
slashes involved from the command-line.

lib/PublicInbox/ExtSearch.pm
lib/PublicInbox/ExtSearchIdx.pm

index 66c99eaa35eae88fd207930fe3165dd692ab7aa2..eb665027e73f754384eb10f101fd0d41ebb3a4a3 100644 (file)
@@ -9,12 +9,14 @@ use strict;
 use v5.10.1;
 use PublicInbox::Over;
 use PublicInbox::Inbox;
+use File::Spec ();
 
 # for ->reopen, ->mset, ->mset_to_artnums
 use parent qw(PublicInbox::Search);
 
 sub new {
        my (undef, $topdir) = @_;
+       $topdir = File::Spec->canonpath($topdir);
        bless {
                topdir => $topdir,
                # xpfx => 'ei15'
index 2bb9afceb2298c6c8458ef2d93eedfbfdb8b4ecc..3e7f560486e38bf3b166d3277d1aeed28002074a 100644 (file)
@@ -30,6 +30,7 @@ use File::Spec;
 
 sub new {
        my (undef, $dir, $opt) = @_;
+       $dir = File::Spec->canonpath($dir);
        my $l = $opt->{indexlevel} // 'full';
        $l !~ $PublicInbox::SearchIdx::INDEXLEVELS and
                die "invalid indexlevel=$l\n";