Skip to content

Commit

Permalink
Windows file path separator in exclude_autogenerated_files(), #722
Browse files Browse the repository at this point in the history
  • Loading branch information
AlDanial committed Jul 8, 2023
1 parent 26d9383 commit be72b7f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cloc
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,14 @@ sub exclude_autogenerated_files { # {{{1
foreach my $file (@{$ra_file_list}) {
my $full_path = File::Spec->catfile($repo_dir, $file);
my $rel_file = File::Spec->abs2rel($full_path, $cwd);
if ($rel_file =~ m{$re}) {
my $match = undef;
if ($ON_WINDOWS) {
$rel_file =~ s{\\}{/}g;
$match = $rel_file =~ m{$re}i;
} else {
$match = $rel_file =~ m{$re};
}
if ($match) {
#print "RULE [$rel_file] v [$re]\n";
$rh_Ignored->{$file} = "matches $GA rule '$line'";
} else {
Expand Down

0 comments on commit be72b7f

Please sign in to comment.