badwords: exclude wordlist input file from search

To avoid hitting all lines in it. It doesn't happen in curl at the
moment, but may happen in the future or in other projects using this
script.

Closes #21819
This commit is contained in:
Viktor Szakats 2026-05-31 22:47:54 +02:00
parent 5364e6e60e
commit 6ff5c8ac4a
No known key found for this signature in database

View file

@ -318,7 +318,7 @@ sub file {
}
my @filemasks = @ARGV;
open(my $git_ls_files, '-|', 'git', 'ls-files', '--', @filemasks) or die "Failed running git ls-files: $!";
open(my $git_ls_files, '-|', 'git', 'ls-files', '--', ":!:$file", @filemasks) or die "Failed running git ls-files: $!";
my @files;
while(my $each = <$git_ls_files>) {
chomp $each;