Skip to content

Commit

Permalink
Windows file path separator in exclude_autogenerated_files(), AlDania…
Browse files Browse the repository at this point in the history
…l#722

also fix typo
  • Loading branch information
AlDanial committed Jul 8, 2023
1 parent be72b7f commit f5ee8dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Unix/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Updates:
https://github.com/AlDanial/cloc
Oct. 5, 2018

This is a bug-fix release to solve miss-handling of git inputs for
This is a bug-fix release to solve mishandling of git inputs for
straight counts in 1.78 (--git --diff works ok in 1.78),
https://github.com/AlDanial/cloc/issues/328.

Expand Down
9 changes: 8 additions & 1 deletion Unix/cloc
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,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 f5ee8dc

Please sign in to comment.