From: Mark Wooding Date: Sun, 11 Jun 2023 15:29:37 +0000 (+0100) Subject: mason/.perl-lib/TrivGal.pm (listdir): Anchor regex to line start. X-Git-Url: https://git.distorted.org.uk/~mdw/tgal/commitdiff_plain/58bc1431796b61e7fdf3564538d28c811b868fd9 mason/.perl-lib/TrivGal.pm (listdir): Anchor regex to line start. I don't think this is actually a problem, because the pattern irrefutably matches at the start of the line anyway. But for form's sake, it should be properly anchored. --- diff --git a/mason/.perl-lib/TrivGal.pm b/mason/.perl-lib/TrivGal.pm index bbef2ed..85bf0cc 100644 --- a/mason/.perl-lib/TrivGal.pm +++ b/mason/.perl-lib/TrivGal.pm @@ -294,7 +294,7 @@ sub listdir ($) { $comment = defined $comment ? $comment . "\n" . $_ : $_; } else { if ($item && $comment) { $item->comment($comment); } - my ($indexp, $name, $c) = /(!\s+)?(\S+)\s*(\S|\S.*\S)?\s*$/; + my ($indexp, $name, $c) = /^(!\s+)?(\S+)\s*(\S|\S.*\S)?\s*$/; $name = urldecode $name; my $list; if ($name =~ m#/$#) {