~mdw
/
tgal
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mason/.perl-lib/TrivGal.pm: Expand a couple of compicated regices.
[tgal]
/
mason
/
.perl-lib
/
TrivGal.pm
diff --git
a/mason/.perl-lib/TrivGal.pm
b/mason/.perl-lib/TrivGal.pm
index
85bf0cc
..
193f122
100644
(file)
--- a/
mason/.perl-lib/TrivGal.pm
+++ b/
mason/.perl-lib/TrivGal.pm
@@
-69,7
+69,10
@@
export qw{split_path};
sub split_path ($) {
my ($path) = @_;
sub split_path ($) {
my ($path) = @_;
- my ($dir, $base, $ext) = $path =~ m#^(?:(.*)/)?(?:([^/]*)\.)?([^./]*)$#;
+ my ($dir, $base, $ext) =
+ $path =~ m#^ (?: (.*) /)?
+ (?: ([^/]*) \.)?
+ ([^./]*) $#x;
if (defined $base) { $ext = ".$ext"; }
else { $base = $ext; $ext = ""; }
return ($dir, $base, $ext);
if (defined $base) { $ext = ".$ext"; }
else { $base = $ext; $ext = ""; }
return ($dir, $base, $ext);
@@
-294,7
+297,12
@@
sub listdir ($) {
$comment = defined $comment ? $comment . "\n" . $_ : $_;
} else {
if ($item && $comment) { $item->comment($comment); }
$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+)? # index flag
+ (\S+) \s* # filename
+ (\S | \S.*\S )? # start of the comment
+ \s*
+ $/x;
$name = urldecode $name;
my $list;
if ($name =~ m#/$#) {
$name = urldecode $name;
my $list;
if ($name =~ m#/$#) {