Archived
1
0
Fork 0

Globbing in grading is not critical

This commit is contained in:
Mercier Pierre-Olivier 2013-09-30 13:08:33 +02:00
commit 6fa013ff14
2 changed files with 18 additions and 9 deletions

View file

@ -290,6 +290,8 @@ use strict;
use warnings;
use Term::ANSIColor qw(:constants);
use ACU::Log;
sub new ($$$$$)
{
my $class = shift;
@ -344,6 +346,7 @@ sub compute ($$$;$$$)
if (defined $ref)
{
eval {
my $glob = Tinyglob::tinyglob($ref);
if ($glob ne $ref)
{
@ -353,6 +356,11 @@ sub compute ($$$;$$$)
}
$ids->{ $ref } = $value;
}
};
if ($@) {
my $err = $@;
log ERROR, $@;
}
}
my $ret = undef;

View file

@ -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 {