mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
badwords: pass config as filename arg
Instead of stdin. To simplify the command-line, and allow using a safe and portable `system()` call from `badwords-all`. Ref: https://perldoc.perl.org/functions/system Closes #20970
This commit is contained in:
parent
3f06e27502
commit
650b33a3db
@ -174,7 +174,9 @@ my %wl;
|
||||
|
||||
my @w;
|
||||
my @exact;
|
||||
while(<STDIN>) {
|
||||
my $file = shift @ARGV;
|
||||
open(CONFIG, "<$file") or die "Cannot open '$file': $!";
|
||||
while(<CONFIG>) {
|
||||
chomp;
|
||||
if($_ =~ /^#/) {
|
||||
next;
|
||||
@ -200,6 +202,7 @@ while(<STDIN>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
close(CONFIG);
|
||||
|
||||
# Build a single combined regex for case-insensitive words
|
||||
my $re_ci;
|
||||
|
||||
@ -8,6 +8,7 @@ use warnings;
|
||||
|
||||
use File::Basename;
|
||||
|
||||
chdir dirname(__FILE__) . "/..";
|
||||
chdir dirname(__FILE__) . '/..';
|
||||
|
||||
exit system("scripts/badwords '**.md' projects/OS400/README.OS400 src lib include docs/examples < scripts/badwords.txt") >> 8;
|
||||
exit system('scripts/badwords', ('scripts/badwords.txt',
|
||||
'**.md', 'projects/OS400/README.OS400', 'src', 'lib', 'include', 'docs/examples')) >> 8;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user