mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
optiontable: replace stdin with filename arg, harden open() call
Closes #21008
This commit is contained in:
parent
f95fadd116
commit
a9e341a469
@ -379,7 +379,7 @@ endif()
|
||||
if(PERL_EXECUTABLE)
|
||||
add_custom_target(curl-optiontable
|
||||
COMMENT "Generating lib/easyoptions.c" VERBATIM USES_TERMINAL
|
||||
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/optiontable.pl" < "${PROJECT_SOURCE_DIR}/include/curl/curl.h"
|
||||
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/optiontable.pl" "${PROJECT_SOURCE_DIR}/include/curl/curl.h"
|
||||
> "${PROJECT_SOURCE_DIR}/lib/easyoptions.c"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/optiontable.pl" "${PROJECT_SOURCE_DIR}/include/curl/curl.h"
|
||||
)
|
||||
|
||||
@ -178,7 +178,7 @@ tidy:
|
||||
@CLANG_TIDY@ --config-file=$(top_srcdir)/.clang-tidy.yml $(TIDYFLAGS) $(CURL_CLANG_TIDYFLAGS) $$_csources -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H $(_tidy_cflags))
|
||||
|
||||
optiontable:
|
||||
@PERL@ $(srcdir)/optiontable.pl < $(top_srcdir)/include/curl/curl.h > $(srcdir)/easyoptions.c
|
||||
@PERL@ $(srcdir)/optiontable.pl $(top_srcdir)/include/curl/curl.h > $(srcdir)/easyoptions.c
|
||||
|
||||
if HAVE_WINDRES
|
||||
.rc.lo:
|
||||
|
||||
@ -79,7 +79,9 @@ sub add {
|
||||
}
|
||||
|
||||
my $fl;
|
||||
while(<STDIN>) {
|
||||
my $file = shift @ARGV;
|
||||
open(CURL_H, '<', $file) or die;
|
||||
while(<CURL_H>) {
|
||||
my $l = $_;
|
||||
if($fl) {
|
||||
# continued deprecation
|
||||
@ -121,6 +123,7 @@ while(<STDIN>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
close(CURL_H);
|
||||
|
||||
for my $name (sort @names) {
|
||||
my $oname = $name;
|
||||
|
||||
@ -34,7 +34,7 @@ sub showline {
|
||||
|
||||
my $root = $ARGV[0] || '..';
|
||||
|
||||
open(my $fh, "-|", "perl $root/lib/optiontable.pl < $root/include/curl/curl.h");
|
||||
open(my $fh, "-|", 'perl', "$root/lib/optiontable.pl", "$root/include/curl/curl.h");
|
||||
binmode $fh;
|
||||
my @gen=<$fh>;
|
||||
close($fh);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user