Skip to content

Commit

Permalink
Item11267: fix construction of perl regex
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Aug 25, 2014
1 parent 82b3927 commit 1d4095e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/pseudo-install.pl
Expand Up @@ -1581,8 +1581,11 @@ sub merge_gitignore {
my $i = 0;

while ( !$matched && $i < $nmatch_rules ) {
my @parts = split( /\*/, $match_rules[$i] );
my $regex = qr/^\Q/ . join( qr/\E.*\Q/, @parts ) . qr/\E$/;
my $regex = '^'
. join( '.*',
map { quotemeta($_) } split( /\*/, $match_rules[$i] ) )
. '$';
$regex = qr/$regex/;

$i += 1;
$matched = ( $file =~ $regex );
Expand Down

0 comments on commit 1d4095e

Please sign in to comment.