mason/.perl-lib/TrivGal.pm (listdir): Refactor how the index flag is set.
[tgal] / mason / .perl-lib / TrivGal.pm
index e329e00..b47835a 100644 (file)
@@ -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);