mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:23:31 +03:00
tidy-up: syntax and code nits
- cmp-pkg-config.sh: replace `-r -f` with `-rf` to match rest of repo. - configure.ac: add double quotes for robustness (not a bug). - curl-openssl.m4: merge nested `if`s. - CurlTests.c: drop `!= 0`, also to sync with m4. - CurlTests.c: replace `example.com` with `localhost` in `gethostbyname()` feature test code. (compile-only, not a bug) - GHA/http3-linux: drop literal `true` from bool expression. - lib650: drop redundant `&`. - move variable/call to left-hand side of equality checks, where missing. - perl: detach `<`/`>` from filename in `open()`, where missing. - schannel: apply two nit fixes lost in rebase. - scripts/verify-release: drop redundant double quotes. - scripts/verify-release: exit with error code on error. - synctime: replace magic numbers with `sizeof()`. - telnet: add missing parentheses to macro value. - tests/Makefile.am: use single quotes. - tool_operate: drop redundant `break` after `return` in VMS code. - unit2413: drop unused NULL pointer + free call. - unit2413: fix duplicate test case name. - urlapi: drop redundant parentheses. - urlapi: drop `CURL_UNCONST()` that became redundant. Closes #22186
This commit is contained in:
parent
a36384ab94
commit
84c5dcdb05
31 changed files with 100 additions and 102 deletions
|
|
@ -137,7 +137,7 @@ endif
|
|||
|
||||
# make sure that PERL is pointing to an executable
|
||||
perlcheck:
|
||||
@if ! test -x "@PERL@"; then echo "No perl!"; exit 2; fi
|
||||
@if ! test -x "@PERL@"; then echo 'No perl!'; exit 2; fi
|
||||
|
||||
build-certs: perlcheck
|
||||
(cd certs && $(MAKE))
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ our %pastversion;
|
|||
|
||||
sub allversions {
|
||||
my ($file) = @_;
|
||||
open(A, "<$file") or
|
||||
open(A, "<", $file) or
|
||||
die "cannot open the versions file $file\n";
|
||||
my $before = 1;
|
||||
my $relcount;
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ static CURLcode test_lib650(const char *URL)
|
|||
}
|
||||
headers = headers2;
|
||||
formrc = curl_formadd(&formpost, &lastptr,
|
||||
CURLFORM_COPYNAME, &testname,
|
||||
CURLFORM_COPYCONTENTS, &testdata,
|
||||
CURLFORM_COPYNAME, testname,
|
||||
CURLFORM_COPYCONTENTS, testdata,
|
||||
CURLFORM_CONTENTHEADER, headers,
|
||||
CURLFORM_END);
|
||||
if(formrc) {
|
||||
|
|
@ -145,7 +145,7 @@ static CURLcode test_lib650(const char *URL)
|
|||
formrc = curl_formadd(&formpost,
|
||||
&lastptr,
|
||||
CURLFORM_COPYNAME, "formlength",
|
||||
CURLFORM_COPYCONTENTS, &flbuf,
|
||||
CURLFORM_COPYCONTENTS, flbuf,
|
||||
CURLFORM_END);
|
||||
|
||||
if(formrc) {
|
||||
|
|
|
|||
|
|
@ -657,31 +657,31 @@ void install_signal_handlers(bool keep_sigalrm)
|
|||
void restore_signal_handlers(bool keep_sigalrm)
|
||||
{
|
||||
#ifdef SIGHUP
|
||||
if(SIG_ERR != old_sighup_handler)
|
||||
if(old_sighup_handler != SIG_ERR)
|
||||
(void)set_signal(SIGHUP, old_sighup_handler, FALSE);
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
if(SIG_ERR != old_sigpipe_handler)
|
||||
if(old_sigpipe_handler != SIG_ERR)
|
||||
(void)set_signal(SIGPIPE, old_sigpipe_handler, FALSE);
|
||||
#endif
|
||||
#ifdef SIGALRM
|
||||
if(!keep_sigalrm) {
|
||||
if(SIG_ERR != old_sigalrm_handler)
|
||||
if(old_sigalrm_handler != SIG_ERR)
|
||||
(void)set_signal(SIGALRM, old_sigalrm_handler, FALSE);
|
||||
}
|
||||
#else
|
||||
(void)keep_sigalrm;
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
if(SIG_ERR != old_sigint_handler)
|
||||
if(old_sigint_handler != SIG_ERR)
|
||||
(void)set_signal(SIGINT, old_sigint_handler, FALSE);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
if(SIG_ERR != old_sigterm_handler)
|
||||
if(old_sigterm_handler != SIG_ERR)
|
||||
(void)set_signal(SIGTERM, old_sigterm_handler, FALSE);
|
||||
#endif
|
||||
#if defined(SIGBREAK) && defined(_WIN32)
|
||||
if(SIG_ERR != old_sigbreak_handler)
|
||||
if(old_sigbreak_handler != SIG_ERR)
|
||||
(void)set_signal(SIGBREAK, old_sigbreak_handler, FALSE);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ else {
|
|||
$fullopt = $longopt;
|
||||
}
|
||||
|
||||
open(R, "<$txt");
|
||||
open(R, "<", $txt);
|
||||
my $show = 0;
|
||||
my @txtout;
|
||||
while(<R>) {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ sub clearlogs {
|
|||
|
||||
sub includefile {
|
||||
my ($f, $text) = @_;
|
||||
open(F, "<$f");
|
||||
open(F, "<", $f);
|
||||
if($text) {
|
||||
binmode F, ':crlf';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ static CURLcode test_unit2413(const char *arg)
|
|||
{
|
||||
UNITTEST_BEGIN_SIMPLE
|
||||
CURL *curl;
|
||||
struct Curl_peer *peer = NULL;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl = curl_easy_init();
|
||||
|
|
@ -95,17 +94,16 @@ static CURLcode test_unit2413(const char *arg)
|
|||
"127.0.0.1", FALSE, NULL);
|
||||
test_create2413("peer3", curl, &Curl_scheme_https, "::1", 1234,
|
||||
"::1", TRUE, NULL);
|
||||
test_create2413("peer3", curl, &Curl_scheme_https, "[::1]", 1234,
|
||||
test_create2413("peer4", curl, &Curl_scheme_https, "[::1]", 1234,
|
||||
"::1", TRUE, NULL);
|
||||
test_create2413("peer4", curl, &Curl_scheme_https, "test.curl.se.", 1234,
|
||||
test_create2413("peer5", curl, &Curl_scheme_https, "test.curl.se.", 1234,
|
||||
"test.curl.se.", FALSE, NULL);
|
||||
test_create2413("peer5", curl, &Curl_scheme_https, "[::1%tada]", 1234,
|
||||
test_create2413("peer6", curl, &Curl_scheme_https, "[::1%tada]", 1234,
|
||||
"::1", TRUE, "tada");
|
||||
test_create2413("peer6", curl, &Curl_scheme_https, "::1%tada", 1234,
|
||||
test_create2413("peer7", curl, &Curl_scheme_https, "::1%tada", 1234,
|
||||
"::1", TRUE, "tada");
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
Curl_peer_unlink(&peer);
|
||||
curl_global_cleanup();
|
||||
|
||||
UNITTEST_END_SIMPLE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue