about summary refs log tree commit homepage
path: root/lib/PublicInbox/Xapcmd.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-04 08:40:34 +0000
committerEric Wong <e@80x24.org>2019-06-04 10:06:18 +0000
commitd3906fed88f403552d1629e9ecc9974ab85abaae (patch)
tree44eece4dff4ac1e7e91566400c32ddb024682ca8 /lib/PublicInbox/Xapcmd.pm
parentb04bdc8cd749dd3dfcc9351b2b47bfdf190b4a3a (diff)
downloadpublic-inbox-d3906fed88f403552d1629e9ecc9974ab85abaae.tar.gz
In case some BOFH decides to randomly create directories
using non-ASCII digits all over the place.
Diffstat (limited to 'lib/PublicInbox/Xapcmd.pm')
-rw-r--r--lib/PublicInbox/Xapcmd.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm
index 90672310..dad080c8 100644
--- a/lib/PublicInbox/Xapcmd.pm
+++ b/lib/PublicInbox/Xapcmd.pm
@@ -150,7 +150,7 @@ sub run {
         } else {
                 opendir my $dh, $old or die "Failed to opendir $old: $!\n";
                 while (defined(my $dn = readdir($dh))) {
-                        if ($dn =~ /\A\d+\z/) {
+                        if ($dn =~ /\A[0-9]+\z/) {
                                 my $tmpl = "$dn-XXXXXXXX";
                                 my $dst = tempdir($tmpl, DIR => $old);
                                 same_fs_or_die($old, $dst);
@@ -200,7 +200,7 @@ sub progress_pfx ($) {
         my @p = split('/', $_[0]);
 
         # return "xap15/0" for v2, or "xapian15" for v1:
-        ($p[-1] =~ /\A\d+\z/) ? "$p[-2]/$p[-1]" : $p[-1];
+        ($p[-1] =~ /\A[0-9]+\z/) ? "$p[-2]/$p[-1]" : $p[-1];
 }
 
 # xapian-compact wrapper
@@ -276,7 +276,7 @@ sub cpdb ($$) {
                         $dst->set_metadata('last_commit', $lc) if $lc;
 
                         # only the first xapian partition (0) gets 'indexlevel'
-                        if ($old =~ m!(?:xapian\d+|xap\d+/0)\z!) {
+                        if ($old =~ m!(?:xapian[0-9]+|xap[0-9]+/0)\z!) {
                                 my $l = $src->get_metadata('indexlevel');
                                 if ($l eq 'medium') {
                                         $dst->set_metadata('indexlevel', $l);