Globbing in grading is not critical
This commit is contained in:
parent
326ce94617
commit
7a192c4732
2 changed files with 16 additions and 9 deletions
|
|
@ -344,14 +344,20 @@ sub compute ($$$;$$$)
|
|||
|
||||
if (defined $ref)
|
||||
{
|
||||
my $glob = Tinyglob::tinyglob($ref);
|
||||
if ($glob ne $ref)
|
||||
{
|
||||
my $value = 0;
|
||||
for my $r (grep { /^$glob$/ } keys %$ids) {
|
||||
$value += $ids->{ $r };
|
||||
eval {
|
||||
my $glob = Tinyglob::tinyglob($ref);
|
||||
if ($glob ne $ref)
|
||||
{
|
||||
my $value = 0;
|
||||
for my $r (grep { /^$glob$/ } keys %$ids) {
|
||||
$value += $ids->{ $r };
|
||||
}
|
||||
$ids->{ $ref } = $value;
|
||||
}
|
||||
$ids->{ $ref } = $value;
|
||||
};
|
||||
if ($@) {
|
||||
my $err = $@;
|
||||
log ERROR, $@;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ our @EXPORT = qw(tinyglob);
|
|||
|
||||
sub tinyglob
|
||||
{
|
||||
my @str = split("", quotemeta(shift));
|
||||
my $orig = shift;
|
||||
my @str = split("", quotemeta($orig));
|
||||
my $res = "";
|
||||
|
||||
my $metaescape = 0;
|
||||
|
|
@ -38,7 +39,7 @@ sub tinyglob
|
|||
$res .= '.*';
|
||||
}
|
||||
else {
|
||||
croak "Invalid number of \\";
|
||||
croak "Invalid number of \\ in '$orig'";
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Reference in a new issue