From: Mark Wooding Date: Mon, 12 Jun 2023 10:44:41 +0000 (+0100) Subject: mason/.perl-lib/TrivGal.pm (listdir): Refactor how the index flag is set. X-Git-Url: https://git.distorted.org.uk/~mdw/tgal/commitdiff_plain/9940cc5a05400f76fda061d9dd827750353eec95 mason/.perl-lib/TrivGal.pm (listdir): Refactor how the index flag is set. Match a collection of flag characters, though only `!' is currently recognized, and then set the flags based on what we see. --- diff --git a/mason/.perl-lib/TrivGal.pm b/mason/.perl-lib/TrivGal.pm index e329e00..b47835a 100644 --- a/mason/.perl-lib/TrivGal.pm +++ b/mason/.perl-lib/TrivGal.pm @@ -303,12 +303,13 @@ sub listdir ($) { $comment = defined $comment ? $comment . "\n" . $_ : $_; } else { if ($item && $comment) { $item->comment($comment); } - my ($indexp, $name, $c) = - /^ (! \s+)? # index flag + my ($flags, $name, $c) = + /^ (?: ([!]+) \s+)? # flags (\S+) \s* # filename (\S | \S.*\S )? # start of the comment \s* $/x; + my $indexp = $flags =~ /!/; $name = urldecode $name; my $list; $item = TrivGal::Item->new($name);