From 2984ff86d913c3a9a9f53e67e141f7a39bf77160 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Jun 2019 01:26:55 +0000 Subject: tighten up digit matches to ASCII for git output While I don't expect git to suddenly start spewing non-ASCII digits in places I'd expect ASCII, this would make things easier for future hackers and reviewers. --- script/public-inbox-convert | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'script') diff --git a/script/public-inbox-convert b/script/public-inbox-convert index bd8fb985..99480c3a 100755 --- a/script/public-inbox-convert +++ b/script/public-inbox-convert @@ -103,7 +103,7 @@ while (<$rd>) { $state = 'blob'; } elsif (/^commit /) { $state = 'commit'; - } elsif (/^data (\d+)/) { + } elsif (/^data ([0-9]+)/) { my $len = $1; $w->print($_) or $im->wfail; while ($len) { @@ -114,7 +114,7 @@ while (<$rd>) { } next; } elsif ($state eq 'commit') { - if (m{^M 100644 :(\d+) (${h}{2}/${h}{38})}o) { + if (m{^M 100644 :([0-9]+) (${h}{2}/${h}{38})}o) { my ($mark, $path) = ($1, $2); $D{$path} = $mark; if ($last && $last ne 'm') { @@ -134,7 +134,7 @@ while (<$rd>) { $last = 'd'; next; } - if (m{^from (:\d+)}) { + if (m{^from (:[0-9]+)}) { $prev = $from; $from = $1; # no next -- cgit v1.2.3-24-ge0c7