]> Sergey Matveev's repositories - public-inbox.git/commitdiff
scripts: require ASCII digits in a few places
authorEric Wong <e@80x24.org>
Wed, 5 Jun 2019 02:01:29 +0000 (02:01 +0000)
committerEric Wong <e@80x24.org>
Wed, 5 Jun 2019 02:01:29 +0000 (02:01 +0000)
I haven't touched most these scripts in ages, but we might as well
purge \d usage from here, as well.

scripts/import_slrnspool
scripts/xhdr-num2mid

index e7ea45c1242a7f616201f4fe7718543e7730ec1b..25b702a05de7fa2948f5baa9c0c721e0b1d469ab 100755 (executable)
@@ -47,7 +47,7 @@ sub get_min {
        my $out = $git->qx('config', "--file=$f", key($ibx));
        $out ||= 0;
        chomp $out;
-       $out =~ /\A\d+\z/ and return $out;
+       $out =~ /\A[0-9]+\z/ and return $out;
        0;
 }
 
index 6f839c555eeadf85f156deadf8b1e8a72f9a36b4..f119ec4f459f8de07ca414be28cb7e03031ae941 100755 (executable)
@@ -23,7 +23,7 @@ my ($num, $first, $last) = $nntp->group($group);
 die "Invalid group\n" if !(defined $num && defined $first && defined $last);
 my $arg_first = shift;
 if (defined $arg_first) {
-       $arg_first =~ /\A\d+\z/ or die $usage;
+       $arg_first =~ /\A[0-9]+\z/ or die $usage;
        $first = $arg_first;
 } elsif ($mm) {
        my $last_article = $mm->meta_accessor('last_article');