From: Viktor Szakats Date: Tue, 8 Jul 2025 11:59:32 +0000 (+0200) Subject: tidy-up: whitespace X-Git-Tag: curl-8_15_0~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8eab2b70860e285525130f69b22ac5567292c659;p=thirdparty%2Fcurl.git tidy-up: whitespace Cherry-picked from #17877 Cherry-picked from #17876 Closes #17896 --- diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions index 54b1d4f222..4603dd322c 100644 --- a/docs/libcurl/symbols-in-versions +++ b/docs/libcurl/symbols-in-versions @@ -207,18 +207,18 @@ CURLAUTH_BEARER 7.61.0 CURLAUTH_DIGEST 7.10.6 CURLAUTH_DIGEST_IE 7.19.3 CURLAUTH_GSSAPI 7.55.0 -CURLAUTH_GSSNEGOTIATE 7.10.6 7.38.0 +CURLAUTH_GSSNEGOTIATE 7.10.6 7.38.0 CURLAUTH_NEGOTIATE 7.38.0 CURLAUTH_NONE 7.10.6 CURLAUTH_NTLM 7.10.6 CURLAUTH_NTLM_WB 7.22.0 8.8.0 CURLAUTH_ONLY 7.21.3 -CURLCLOSEPOLICY_CALLBACK 7.7 7.16.1 -CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7 7.16.1 -CURLCLOSEPOLICY_LEAST_TRAFFIC 7.7 7.16.1 -CURLCLOSEPOLICY_NONE 7.7 7.16.1 -CURLCLOSEPOLICY_OLDEST 7.7 7.16.1 -CURLCLOSEPOLICY_SLOWEST 7.7 7.16.1 +CURLCLOSEPOLICY_CALLBACK 7.7 7.16.1 +CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7 7.16.1 +CURLCLOSEPOLICY_LEAST_TRAFFIC 7.7 7.16.1 +CURLCLOSEPOLICY_NONE 7.7 7.16.1 +CURLCLOSEPOLICY_OLDEST 7.7 7.16.1 +CURLCLOSEPOLICY_SLOWEST 7.7 7.16.1 CURLE_ABORTED_BY_CALLBACK 7.1 CURLE_AGAIN 7.18.2 CURLE_ALREADY_COMPLETE 7.7.2 7.8 diff --git a/lib/bufq.h b/lib/bufq.h index 63fc916034..7cd1826a95 100644 --- a/lib/bufq.h +++ b/lib/bufq.h @@ -170,8 +170,8 @@ CURLcode Curl_bufq_write(struct bufq *q, size_t *pnwritten); CURLcode Curl_bufq_cwrite(struct bufq *q, - const char *buf, size_t len, - size_t *pnwritten); + const char *buf, size_t len, + size_t *pnwritten); /** * Read buf from the start of the buffer queue. The buf is copied @@ -206,8 +206,8 @@ bool Curl_bufq_peek_at(struct bufq *q, size_t offset, void Curl_bufq_skip(struct bufq *q, size_t amount); typedef CURLcode Curl_bufq_writer(void *writer_ctx, - const unsigned char *buf, size_t len, - size_t *pwritten); + const unsigned char *buf, size_t len, + size_t *pwritten); /** * Passes the chunks in the buffer queue to the writer and returns * the amount of buf written. A writer may return -1 and CURLE_AGAIN diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index 56c4d88d0b..4aac877fc1 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -683,8 +683,8 @@ out: } static void cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { struct h1_tunnel_state *ts = cf->ctx; diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index b1ad5bc235..8a853f6b1d 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -81,7 +81,7 @@ struct tunnel_stream { }; static CURLcode tunnel_stream_init(struct Curl_cfilter *cf, - struct tunnel_stream *ts) + struct tunnel_stream *ts) { const char *hostname; int port; @@ -268,8 +268,8 @@ static int proxy_h2_client_new(struct Curl_cfilter *cf, } static ssize_t on_session_send(nghttp2_session *h2, - const uint8_t *buf, size_t blen, - int flags, void *userp); + const uint8_t *buf, size_t blen, + int flags, void *userp); static int proxy_h2_on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, void *userp); diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index 8c3e01e6d8..474769d1cb 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -424,8 +424,8 @@ static CURLcode cf_hc_shutdown(struct Curl_cfilter *cf, } static void cf_hc_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { if(!cf->connected) { struct cf_hc_ctx *ctx = cf->ctx; diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 4187a6b2cf..2a7311eb3b 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -394,10 +394,10 @@ static CURLcode socket_open(struct Curl_easy *data, * */ CURLcode Curl_socket_open(struct Curl_easy *data, - const struct Curl_addrinfo *ai, - struct Curl_sockaddr_ex *addr, - int transport, - curl_socket_t *sockfd) + const struct Curl_addrinfo *ai, + struct Curl_sockaddr_ex *addr, + int transport, + curl_socket_t *sockfd) { struct Curl_sockaddr_ex dummy; CURLcode result; @@ -1092,7 +1092,7 @@ static CURLcode set_remote_ip(struct Curl_cfilter *cf, } static CURLcode cf_socket_open(struct Curl_cfilter *cf, - struct Curl_easy *data) + struct Curl_easy *data) { struct cf_socket_ctx *ctx = cf->ctx; int error = 0; @@ -1376,8 +1376,8 @@ out: } static void cf_socket_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { struct cf_socket_ctx *ctx = cf->ctx; @@ -1992,7 +1992,7 @@ out: } static timediff_t cf_tcp_accept_timeleft(struct Curl_cfilter *cf, - struct Curl_easy *data) + struct Curl_easy *data) { struct cf_socket_ctx *ctx = cf->ctx; timediff_t timeout_ms = DEFAULT_ACCEPT_TIMEOUT; diff --git a/lib/cf-socket.h b/lib/cf-socket.h index d3e3509842..90daf079a0 100644 --- a/lib/cf-socket.h +++ b/lib/cf-socket.h @@ -68,10 +68,10 @@ CURLcode Curl_parse_interface(const char *input, * */ CURLcode Curl_socket_open(struct Curl_easy *data, - const struct Curl_addrinfo *ai, - struct Curl_sockaddr_ex *addr, - int transport, - curl_socket_t *sockfd); + const struct Curl_addrinfo *ai, + struct Curl_sockaddr_ex *addr, + int transport, + curl_socket_t *sockfd); int Curl_socket_close(struct Curl_easy *data, struct connectdata *conn, curl_socket_t sock); diff --git a/lib/cfilters.c b/lib/cfilters.c index 4c0f48606f..e3247f72c9 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -68,8 +68,8 @@ static void conn_report_connect_stats(struct Curl_easy *data, struct connectdata *conn); void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { /* NOP */ (void)cf; @@ -757,8 +757,8 @@ void Curl_conn_get_current_host(struct Curl_easy *data, int sockindex, } CURLcode Curl_cf_def_cntrl(struct Curl_cfilter *cf, - struct Curl_easy *data, - int event, int arg1, void *arg2) + struct Curl_easy *data, + int event, int arg1, void *arg2) { (void)cf; (void)data; @@ -952,8 +952,8 @@ CURLcode Curl_conn_keep_alive(struct Curl_easy *data, } size_t Curl_conn_get_max_concurrent(struct Curl_easy *data, - struct connectdata *conn, - int sockindex) + struct connectdata *conn, + int sockindex) { CURLcode result; int n = 0; @@ -1040,8 +1040,8 @@ void Curl_pollset_reset(struct Curl_easy *data, * */ void Curl_pollset_change(struct Curl_easy *data, - struct easy_pollset *ps, curl_socket_t sock, - int add_flags, int remove_flags) + struct easy_pollset *ps, curl_socket_t sock, + int add_flags, int remove_flags) { unsigned int i; diff --git a/lib/connect.c b/lib/connect.c index 90acdd3a78..406206d493 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -456,7 +456,7 @@ static CURLcode eyeballer_new(struct eyeballer **pballer, } static void baller_close(struct eyeballer *baller, - struct Curl_easy *data) + struct Curl_easy *data) { if(baller && baller->cf) { Curl_conn_cf_discard_chain(&baller->cf, data); @@ -464,7 +464,7 @@ static void baller_close(struct eyeballer *baller, } static void baller_free(struct eyeballer *baller, - struct Curl_easy *data) + struct Curl_easy *data) { if(baller) { baller_close(baller, data); @@ -933,8 +933,8 @@ static CURLcode cf_he_shutdown(struct Curl_cfilter *cf, } static void cf_he_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { struct cf_he_ctx *ctx = cf->ctx; size_t i; @@ -1047,8 +1047,8 @@ static bool cf_he_data_pending(struct Curl_cfilter *cf, } static struct curltime get_max_baller_time(struct Curl_cfilter *cf, - struct Curl_easy *data, - int query) + struct Curl_easy *data, + int query) { struct cf_he_ctx *ctx = cf->ctx; struct curltime t, tmax; diff --git a/lib/content_encoding.c b/lib/content_encoding.c index bafd99bd77..9ea4a047c8 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -342,7 +342,7 @@ static CURLcode gzip_do_write(struct Curl_easy *data, } static void gzip_do_close(struct Curl_easy *data, - struct Curl_cwriter *writer) + struct Curl_cwriter *writer) { struct zlib_writer *zp = (struct zlib_writer *) writer; z_stream *z = &zp->z; /* zlib state structure */ @@ -463,7 +463,7 @@ static CURLcode brotli_do_write(struct Curl_easy *data, } static void brotli_do_close(struct Curl_easy *data, - struct Curl_cwriter *writer) + struct Curl_cwriter *writer) { struct brotli_writer *bp = (struct brotli_writer *) writer; (void) data; @@ -566,7 +566,7 @@ static CURLcode zstd_do_write(struct Curl_easy *data, } static void zstd_do_close(struct Curl_easy *data, - struct Curl_cwriter *writer) + struct Curl_cwriter *writer) { struct zstd_writer *zp = (struct zstd_writer *) writer; (void)data; @@ -687,7 +687,7 @@ static CURLcode error_do_write(struct Curl_easy *data, } static void error_do_close(struct Curl_easy *data, - struct Curl_cwriter *writer) + struct Curl_cwriter *writer) { (void) data; (void) writer; diff --git a/lib/cshutdn.c b/lib/cshutdn.c index e5799d611e..c8b40dc321 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -114,8 +114,8 @@ static void cshutdn_run_once(struct Curl_easy *data, } void Curl_cshutdn_run_once(struct Curl_easy *data, - struct connectdata *conn, - bool *done) + struct connectdata *conn, + bool *done) { DEBUGASSERT(!data->conn); Curl_attach_connection(data, conn); @@ -212,8 +212,8 @@ bool Curl_cshutdn_close_oldest(struct Curl_easy *data, #define NUM_POLLS_ON_STACK 10 static CURLcode cshutdn_wait(struct cshutdn *cshutdn, - struct Curl_easy *data, - int timeout_ms) + struct Curl_easy *data, + int timeout_ms) { struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK]; struct curl_pollfds cpfds; @@ -234,7 +234,7 @@ out: static void cshutdn_perform(struct cshutdn *cshutdn, - struct Curl_easy *data) + struct Curl_easy *data) { struct Curl_llist_node *e = Curl_llist_head(&cshutdn->list); struct Curl_llist_node *enext; @@ -395,8 +395,8 @@ size_t Curl_cshutdn_dest_count(struct Curl_easy *data, static CURLMcode cshutdn_update_ev(struct cshutdn *cshutdn, - struct Curl_easy *data, - struct connectdata *conn) + struct Curl_easy *data, + struct connectdata *conn) { CURLMcode mresult; @@ -411,8 +411,8 @@ static CURLMcode cshutdn_update_ev(struct cshutdn *cshutdn, void Curl_cshutdn_add(struct cshutdn *cshutdn, - struct connectdata *conn, - size_t conns_in_pool) + struct connectdata *conn, + size_t conns_in_pool) { struct Curl_easy *data = cshutdn->multi->admin; size_t max_total = (cshutdn->multi->max_total_connections > 0) ? @@ -444,8 +444,8 @@ void Curl_cshutdn_add(struct cshutdn *cshutdn, static void cshutdn_multi_socket(struct cshutdn *cshutdn, - struct Curl_easy *data, - curl_socket_t s) + struct Curl_easy *data, + curl_socket_t s) { struct Curl_llist_node *e; struct connectdata *conn; diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 79a658fda5..00e79414cb 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -224,46 +224,46 @@ #ifdef HTTP_ONLY # ifndef CURL_DISABLE_DICT -# define CURL_DISABLE_DICT +# define CURL_DISABLE_DICT # endif # ifndef CURL_DISABLE_FILE -# define CURL_DISABLE_FILE +# define CURL_DISABLE_FILE # endif # ifndef CURL_DISABLE_FTP -# define CURL_DISABLE_FTP +# define CURL_DISABLE_FTP # endif # ifndef CURL_DISABLE_GOPHER -# define CURL_DISABLE_GOPHER +# define CURL_DISABLE_GOPHER # endif # ifndef CURL_DISABLE_IMAP -# define CURL_DISABLE_IMAP +# define CURL_DISABLE_IMAP # endif # ifndef CURL_DISABLE_LDAP -# define CURL_DISABLE_LDAP +# define CURL_DISABLE_LDAP # endif # ifndef CURL_DISABLE_LDAPS -# define CURL_DISABLE_LDAPS +# define CURL_DISABLE_LDAPS # endif # ifndef CURL_DISABLE_MQTT -# define CURL_DISABLE_MQTT +# define CURL_DISABLE_MQTT # endif # ifndef CURL_DISABLE_POP3 -# define CURL_DISABLE_POP3 +# define CURL_DISABLE_POP3 # endif # ifndef CURL_DISABLE_RTSP -# define CURL_DISABLE_RTSP +# define CURL_DISABLE_RTSP # endif # ifndef CURL_DISABLE_SMB -# define CURL_DISABLE_SMB +# define CURL_DISABLE_SMB # endif # ifndef CURL_DISABLE_SMTP -# define CURL_DISABLE_SMTP +# define CURL_DISABLE_SMTP # endif # ifndef CURL_DISABLE_TELNET -# define CURL_DISABLE_TELNET +# define CURL_DISABLE_TELNET # endif # ifndef CURL_DISABLE_TFTP -# define CURL_DISABLE_TFTP +# define CURL_DISABLE_TFTP # endif #endif @@ -566,7 +566,7 @@ # endif # endif # ifndef SIZEOF_OFF_T -# define SIZEOF_OFF_T 4 +# define SIZEOF_OFF_T 4 # endif #endif diff --git a/lib/curl_trc.c b/lib/curl_trc.c index b9cce523d0..334b6e2a1d 100644 --- a/lib/curl_trc.c +++ b/lib/curl_trc.c @@ -205,7 +205,7 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...) static void trc_infof(struct Curl_easy *data, struct curl_trc_feat *feat, const char *opt_id, int opt_id_idx, - const char * const fmt, va_list ap) CURL_PRINTF(5, 0); + const char * const fmt, va_list ap) CURL_PRINTF(5, 0); static void trc_infof(struct Curl_easy *data, struct curl_trc_feat *feat, diff --git a/lib/curlx/strparse.c b/lib/curlx/strparse.c index 992aa15615..ecdf5b9615 100644 --- a/lib/curlx/strparse.c +++ b/lib/curlx/strparse.c @@ -43,7 +43,7 @@ void curlx_str_assign(struct Curl_str *out, const char *str, size_t len) /* Get a word until the first DELIM or end of string. At least one byte long. return non-zero on error */ int curlx_str_until(const char **linep, struct Curl_str *out, - const size_t max, char delim) + const size_t max, char delim) { const char *s = *linep; size_t len = 0; @@ -67,7 +67,7 @@ int curlx_str_until(const char **linep, struct Curl_str *out, /* Get a word until the first space or end of string. At least one byte long. return non-zero on error */ int curlx_str_word(const char **linep, struct Curl_str *out, - const size_t max) + const size_t max) { return curlx_str_until(linep, out, max, ' '); } @@ -75,7 +75,7 @@ int curlx_str_word(const char **linep, struct Curl_str *out, /* Get a word until a newline byte or end of string. At least one byte long. return non-zero on error */ int curlx_str_untilnl(const char **linep, struct Curl_str *out, - const size_t max) + const size_t max) { const char *s = *linep; size_t len = 0; @@ -99,7 +99,7 @@ int curlx_str_untilnl(const char **linep, struct Curl_str *out, /* Get a "quoted" word. No escaping possible. return non-zero on error */ int curlx_str_quotedword(const char **linep, struct Curl_str *out, - const size_t max) + const size_t max) { const char *s = *linep; size_t len = 0; diff --git a/lib/curlx/strparse.h b/lib/curlx/strparse.h index 17bfdb8071..6a0bf28d6c 100644 --- a/lib/curlx/strparse.h +++ b/lib/curlx/strparse.h @@ -55,17 +55,17 @@ int curlx_str_word(const char **linep, struct Curl_str *out, const size_t max); /* Get a word until the first DELIM or end of string return non-zero on error */ int curlx_str_until(const char **linep, struct Curl_str *out, const size_t max, - char delim); + char delim); /* Get a word until a newline byte or end of string. At least one byte long. return non-zero on error */ int curlx_str_untilnl(const char **linep, struct Curl_str *out, - const size_t max); + const size_t max); /* Get a "quoted" word. No escaping possible. return non-zero on error */ int curlx_str_quotedword(const char **linep, struct Curl_str *out, - const size_t max); + const size_t max); /* Advance over a single character. return non-zero on error */ diff --git a/lib/doh.c b/lib/doh.c index 376437c8b1..f96ae0824a 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -588,7 +588,7 @@ static void doh_store_a(const unsigned char *doh, int index, } static void doh_store_aaaa(const unsigned char *doh, int index, - struct dohentry *d) + struct dohentry *d) { /* silently ignore addresses over the limit */ if(d->numaddr < DOH_MAX_ADDR) { diff --git a/lib/ftp.c b/lib/ftp.c index 60beb2c9d2..5e505887b1 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3155,8 +3155,8 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, /* called repeatedly until done from multi.c */ static CURLcode ftp_statemach(struct Curl_easy *data, - struct ftp_conn *ftpc, - bool *done) + struct ftp_conn *ftpc, + bool *done) { CURLcode result = Curl_pp_statemach(data, &ftpc->pp, FALSE, FALSE); diff --git a/lib/hash.c b/lib/hash.c index 8d13aae483..89f47ed71e 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -353,7 +353,7 @@ size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num) } size_t curlx_str_key_compare(void *k1, size_t key1_len, - void *k2, size_t key2_len) + void *k2, size_t key2_len) { if((key1_len == key2_len) && !memcmp(k1, k2, key1_len)) return 1; diff --git a/lib/hash.h b/lib/hash.h index 314b811e4a..fcd92db664 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -99,7 +99,7 @@ void Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, int (*comp)(void *, void *)); size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num); size_t curlx_str_key_compare(void *k1, size_t key1_len, void *k2, - size_t key2_len); + size_t key2_len); void Curl_hash_start_iterate(struct Curl_hash *hash, struct Curl_hash_iterator *iter); struct Curl_hash_element * diff --git a/lib/http2.c b/lib/http2.c index a8f6ae439f..36dca426de 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -1951,7 +1951,7 @@ static void h2_pri_spec(struct cf_h2_ctx *ctx, * Flush any out data pending in the network buffer. */ static CURLcode h2_progress_egress(struct Curl_cfilter *cf, - struct Curl_easy *data) + struct Curl_easy *data) { struct cf_h2_ctx *ctx = cf->ctx; struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data); diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index 7425382359..92c0c1ff4c 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -537,8 +537,8 @@ static int compare_func(const void *a, const void *b) } UNITTEST CURLcode canon_path(const char *q, size_t len, - struct dynbuf *new_path, - bool do_uri_encode) + struct dynbuf *new_path, + bool do_uri_encode) { CURLcode result = CURLE_OK; diff --git a/lib/memdebug.c b/lib/memdebug.c index 5bce90bd93..bdcdcbb907 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -304,7 +304,7 @@ void curl_dbg_free(void *ptr, int line, const char *source) } curl_socket_t curl_dbg_socket(int domain, int type, int protocol, - int line, const char *source) + int line, const char *source) { curl_socket_t sockfd; @@ -351,8 +351,8 @@ RECV_TYPE_RETV curl_dbg_recv(RECV_TYPE_ARG1 sockfd, RECV_TYPE_ARG2 buf, #ifdef HAVE_SOCKETPAIR int curl_dbg_socketpair(int domain, int type, int protocol, - curl_socket_t socket_vector[2], - int line, const char *source) + curl_socket_t socket_vector[2], + int line, const char *source) { int res = (socketpair)(domain, type, protocol, socket_vector); @@ -366,7 +366,7 @@ int curl_dbg_socketpair(int domain, int type, int protocol, #endif curl_socket_t curl_dbg_accept(curl_socket_t s, void *saddr, void *saddrlen, - int line, const char *source) + int line, const char *source) { struct sockaddr *addr = (struct sockaddr *)saddr; curl_socklen_t *addrlen = (curl_socklen_t *)saddrlen; diff --git a/lib/mime.c b/lib/mime.c index 07e141c703..06cd221abf 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -67,12 +67,12 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems, /* Encoders. */ static size_t encoder_nop_read(char *buffer, size_t size, bool ateof, - curl_mimepart *part); + curl_mimepart *part); static curl_off_t encoder_nop_size(curl_mimepart *part); static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof, curl_mimepart *part); static size_t encoder_base64_read(char *buffer, size_t size, bool ateof, - curl_mimepart *part); + curl_mimepart *part); static curl_off_t encoder_base64_size(curl_mimepart *part); static size_t encoder_qp_read(char *buffer, size_t size, bool ateof, curl_mimepart *part); @@ -433,7 +433,7 @@ static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof, /* Base64 content encoder. */ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof, - curl_mimepart *part) + curl_mimepart *part) { struct mime_encoder_state *st = &part->encstate; size_t cursize = 0; diff --git a/lib/mqtt.c b/lib/mqtt.c index 2af430b3b6..90f857dca5 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -240,7 +240,7 @@ static int mqtt_encode_len(char *buf, size_t len) /* add the passwd to the CONNECT packet */ static int add_passwd(const char *passwd, const size_t plen, - char *pkt, const size_t start, int remain_pos) + char *pkt, const size_t start, int remain_pos) { /* magic number that need to be set properly */ const size_t conn_flags_pos = remain_pos + 8; diff --git a/lib/multi.c b/lib/multi.c index fe2cca4039..a1679c7b76 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -2809,7 +2809,7 @@ CURLMcode curl_multi_cleanup(CURLM *m) #ifdef DEBUGBUILD if(mid != data->mid) { CURL_TRC_M(data, "multi_cleanup: still present with mid=%u, " - "but unexpected data->mid=%u\n", mid, data->mid); + "but unexpected data->mid=%u\n", mid, data->mid); DEBUGASSERT(0); } #endif @@ -3894,7 +3894,7 @@ void Curl_multi_mark_dirty(struct Curl_easy *data) #ifdef DEBUGBUILD static void multi_xfer_dump(struct Curl_multi *multi, unsigned int mid, - void *entry) + void *entry) { struct Curl_easy *data = entry; diff --git a/lib/multiif.h b/lib/multiif.h index e68a278a8d..1ba0d0f838 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -36,7 +36,7 @@ bool Curl_expire_clear(struct Curl_easy *data); void Curl_expire_done(struct Curl_easy *data, expire_id id); CURLMcode Curl_update_timer(struct Curl_multi *multi) WARN_UNUSED_RESULT; void Curl_attach_connection(struct Curl_easy *data, - struct connectdata *conn); + struct connectdata *conn); void Curl_detach_connection(struct Curl_easy *data); bool Curl_multiplex_wanted(const struct Curl_multi *multi); void Curl_set_in_callback(struct Curl_easy *data, bool value); @@ -106,7 +106,7 @@ void Curl_multi_getsock(struct Curl_easy *data, * CURLE_AGAIN if the buffer is borrowed already. */ CURLcode Curl_multi_xfer_buf_borrow(struct Curl_easy *data, - char **pbuf, size_t *pbuflen); + char **pbuf, size_t *pbuflen); /** * Release the borrowed buffer. All references into the buffer become * invalid after this. diff --git a/lib/rand.c b/lib/rand.c index c0368dd763..72545e0867 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -103,8 +103,8 @@ CURLcode Curl_win32_random(unsigned char *entropy, size_t length) #if !defined(USE_SSL) /* ---- possibly non-cryptographic version following ---- */ static CURLcode weak_random(struct Curl_easy *data, - unsigned char *entropy, - size_t length) /* always 4, size of int */ + unsigned char *entropy, + size_t length) /* always 4, size of int */ { unsigned int r; DEBUGASSERT(length == sizeof(int)); diff --git a/lib/sendf.c b/lib/sendf.c index 243829e273..339a8773b4 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -177,8 +177,8 @@ void Curl_creader_set_rewind(struct Curl_easy *data, bool enable) /* Write data using an unencoding writer stack. */ CURLcode Curl_cwriter_write(struct Curl_easy *data, - struct Curl_cwriter *writer, int type, - const char *buf, size_t nbytes) + struct Curl_cwriter *writer, int type, + const char *buf, size_t nbytes) { if(!writer) return CURLE_WRITE_ERROR; @@ -377,9 +377,9 @@ static const struct Curl_cwtype cw_raw = { /* Create an unencoding writer stage using the given handler. */ CURLcode Curl_cwriter_create(struct Curl_cwriter **pwriter, - struct Curl_easy *data, - const struct Curl_cwtype *cwt, - Curl_cwriter_phase phase) + struct Curl_easy *data, + const struct Curl_cwtype *cwt, + Curl_cwriter_phase phase) { struct Curl_cwriter *writer = NULL; CURLcode result = CURLE_OUT_OF_MEMORY; @@ -404,7 +404,7 @@ out: } void Curl_cwriter_free(struct Curl_easy *data, - struct Curl_cwriter *writer) + struct Curl_cwriter *writer) { if(writer) { writer->cwt->do_close(data, writer); @@ -1368,7 +1368,7 @@ static const struct Curl_crtype cr_buf = { }; CURLcode Curl_creader_set_buf(struct Curl_easy *data, - const char *buf, size_t blen) + const char *buf, size_t blen) { CURLcode result; struct Curl_creader *r; diff --git a/lib/socks.c b/lib/socks.c index c7af0f4cb3..7d25ef5208 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -1146,8 +1146,8 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, } static void socks_cf_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { struct socks_state *sx = cf->ctx; diff --git a/lib/telnet.c b/lib/telnet.c index b84b66862c..bd599dece2 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -170,7 +170,7 @@ static void sendsuboption(struct Curl_easy *data, static CURLcode telnet_do(struct Curl_easy *data, bool *done); static CURLcode telnet_done(struct Curl_easy *data, - CURLcode, bool premature); + CURLcode, bool premature); static CURLcode send_telnet_data(struct Curl_easy *data, struct TELNET *tn, char *buffer, ssize_t nread); diff --git a/lib/uint-hash.c b/lib/uint-hash.c index 58a1cf59f9..6c66507887 100644 --- a/lib/uint-hash.c +++ b/lib/uint-hash.c @@ -107,8 +107,8 @@ static void uint_hash_entry_unlink(struct uint_hash *h, } static void uint_hash_elem_link(struct uint_hash *h, - struct uint_hash_entry **he_anchor, - struct uint_hash_entry *he) + struct uint_hash_entry **he_anchor, + struct uint_hash_entry *he) { he->next = *he_anchor; *he_anchor = he; diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index 719abd1960..8fc5d41b9a 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -127,7 +127,7 @@ void Curl_auth_create_login_message(const char *valuep, struct bufref *out) * Returns void. */ void Curl_auth_create_external_message(const char *user, - struct bufref *out) + struct bufref *out) { /* This is the same formatting as the login message */ Curl_auth_create_login_message(user, out); diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 9d5fd659d7..898629a958 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -152,7 +152,7 @@ static void auth_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */ /* Convert sha256 or SHA-512/256 chunk to RFC7616 -suitable ASCII string */ static void auth_digest_sha256_to_ascii(unsigned char *source, /* 32 bytes */ - unsigned char *dest) /* 65 bytes */ + unsigned char *dest) /* 65 bytes */ { int i; for(i = 0; i < 32; i++) diff --git a/lib/vauth/oauth2.c b/lib/vauth/oauth2.c index 76e77c6a2f..a84dc60daf 100644 --- a/lib/vauth/oauth2.c +++ b/lib/vauth/oauth2.c @@ -94,8 +94,8 @@ CURLcode Curl_auth_create_oauth_bearer_message(const char *user, * Returns CURLE_OK on success. */ CURLcode Curl_auth_create_xoauth_bearer_message(const char *user, - const char *bearer, - struct bufref *out) + const char *bearer, + struct bufref *out) { /* Generate the message */ char *xoauth = aprintf("user=%s\1auth=Bearer %s\1\1", user, bearer); diff --git a/lib/vquic/curl_msh3.c b/lib/vquic/curl_msh3.c index 2f0c9de848..6566447ba1 100644 --- a/lib/vquic/curl_msh3.c +++ b/lib/vquic/curl_msh3.c @@ -83,16 +83,16 @@ static void MSH3_CALL msh3_conn_connected(MSH3_CONNECTION *Connection, void *IfContext); static void MSH3_CALL msh3_conn_shutdown_complete(MSH3_CONNECTION *Connection, - void *IfContext); + void *IfContext); static void MSH3_CALL msh3_conn_new_request(MSH3_CONNECTION *Connection, - void *IfContext, - MSH3_REQUEST *Request); + void *IfContext, + MSH3_REQUEST *Request); static void MSH3_CALL msh3_header_received(MSH3_REQUEST *Request, void *IfContext, const MSH3_HEADER *Header); static bool MSH3_CALL msh3_data_received(MSH3_REQUEST *Request, - void *IfContext, uint32_t *Length, - const uint8_t *Data); + void *IfContext, uint32_t *Length, + const uint8_t *Data); static void MSH3_CALL msh3_complete(MSH3_REQUEST *Request, void *IfContext, bool Aborted, uint64_t AbortError); static void MSH3_CALL msh3_shutdown_complete(MSH3_REQUEST *Request, @@ -278,7 +278,7 @@ static void MSH3_CALL msh3_conn_connected(MSH3_CONNECTION *Connection, } static void MSH3_CALL msh3_conn_shutdown_complete(MSH3_CONNECTION *Connection, - void *IfContext) + void *IfContext) { struct Curl_cfilter *cf = IfContext; struct cf_msh3_ctx *ctx = cf->ctx; @@ -291,8 +291,8 @@ static void MSH3_CALL msh3_conn_shutdown_complete(MSH3_CONNECTION *Connection, } static void MSH3_CALL msh3_conn_new_request(MSH3_CONNECTION *Connection, - void *IfContext, - MSH3_REQUEST *Request) + void *IfContext, + MSH3_REQUEST *Request) { (void)Connection; (void)IfContext; diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index c534e905f6..805e52513f 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -374,8 +374,8 @@ static void pktx_init(struct pkt_io_ctx *pktx, } static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id, - uint64_t datalen, void *user_data, - void *stream_user_data); + uint64_t datalen, void *user_data, + void *stream_user_data); static ngtcp2_conn *get_conn(ngtcp2_crypto_conn_ref *conn_ref) { @@ -895,8 +895,8 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, } static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { struct cf_ngtcp2_ctx *ctx = cf->ctx; bool want_recv, want_send; diff --git a/lib/vquic/curl_ngtcp2.h b/lib/vquic/curl_ngtcp2.h index 884662523f..a4ccef49fe 100644 --- a/lib/vquic/curl_ngtcp2.h +++ b/lib/vquic/curl_ngtcp2.h @@ -52,9 +52,9 @@ struct Curl_cfilter; void Curl_ngtcp2_ver(char *p, size_t len); CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf, - struct Curl_easy *data, - struct connectdata *conn, - const struct Curl_addrinfo *ai); + struct Curl_easy *data, + struct connectdata *conn, + const struct Curl_addrinfo *ai); bool Curl_conn_is_ngtcp2(const struct Curl_easy *data, const struct connectdata *conn, diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index ec3a2e0ad0..90fed6c44f 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -560,7 +560,7 @@ static CURLcode cf_osslq_ssl_err(struct Curl_cfilter *cf, } static CURLcode cf_osslq_verify_peer(struct Curl_cfilter *cf, - struct Curl_easy *data) + struct Curl_easy *data) { struct cf_osslq_ctx *ctx = cf->ctx; @@ -1242,8 +1242,8 @@ struct h3_quic_recv_ctx { }; static CURLcode h3_quic_recv(void *reader_ctx, - unsigned char *buf, size_t len, - size_t *pnread) + unsigned char *buf, size_t len, + size_t *pnread) { struct h3_quic_recv_ctx *x = reader_ctx; int rv; diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index c4331c46bb..920913d288 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -818,8 +818,8 @@ out: } static CURLcode recv_closed_stream(struct Curl_cfilter *cf, - struct Curl_easy *data, - size_t *pnread) + struct Curl_easy *data, + size_t *pnread) { struct cf_quiche_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index b5dc44f8aa..1eb67f516f 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -308,7 +308,7 @@ CURLcode vquic_flush(struct Curl_cfilter *cf, struct Curl_easy *data, } CURLcode vquic_send(struct Curl_cfilter *cf, struct Curl_easy *data, - struct cf_quic_ctx *qctx, size_t gsolen) + struct cf_quic_ctx *qctx, size_t gsolen) { qctx->gsolen = gsolen; return vquic_flush(cf, data, qctx); diff --git a/lib/vquic/vquic_int.h b/lib/vquic/vquic_int.h index 4641c3125b..d271368d29 100644 --- a/lib/vquic/vquic_int.h +++ b/lib/vquic/vquic_int.h @@ -68,7 +68,7 @@ CURLcode vquic_send_blocked_pkts(struct Curl_cfilter *cf, struct cf_quic_ctx *qctx); CURLcode vquic_send(struct Curl_cfilter *cf, struct Curl_easy *data, - struct cf_quic_ctx *qctx, size_t gsolen); + struct cf_quic_ctx *qctx, size_t gsolen); CURLcode vquic_send_tail_split(struct Curl_cfilter *cf, struct Curl_easy *data, struct cf_quic_ctx *qctx, size_t gsolen, diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 5748f671d1..d599d3cc50 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -1797,7 +1797,7 @@ static CURLcode ssh_state_auth_host_init(struct Curl_easy *data, } static CURLcode ssh_state_auth_agent_init(struct Curl_easy *data, - struct ssh_conn *sshc) + struct ssh_conn *sshc) { int rc = 0; if((data->set.ssh_auth_types & CURLSSH_AUTH_AGENT) @@ -1906,7 +1906,7 @@ static CURLcode ssh_state_auth_key_init(struct Curl_easy *data, } static CURLcode ssh_state_auth_key(struct Curl_easy *data, - struct ssh_conn *sshc) + struct ssh_conn *sshc) { /* Authentication failed. Continue with keyboard-interactive now. */ struct connectdata *conn = data->conn; @@ -2262,7 +2262,7 @@ static CURLcode ssh_state_sftp_quote_unlink(struct Curl_easy *data, } static CURLcode ssh_state_sftp_quote_statvfs(struct Curl_easy *data, - struct ssh_conn *sshc) + struct ssh_conn *sshc) { LIBSSH2_SFTP_STATVFS statvfs; int rc = libssh2_sftp_statvfs(sshc->sftp_session, sshc->quote_path1, @@ -2507,7 +2507,7 @@ static CURLcode ssh_state_sftp_close(struct Curl_easy *data, } static CURLcode ssh_state_sftp_shutdown(struct Curl_easy *data, - struct ssh_conn *sshc) + struct ssh_conn *sshc) { /* during times we get here due to a broken transfer and then the sftp_handle might not have been taken down so make sure that is done @@ -3886,7 +3886,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, } static CURLcode sftp_done(struct Curl_easy *data, CURLcode status, - bool premature) + bool premature) { struct connectdata *conn = data->conn; struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); diff --git a/lib/vssh/wolfssh.c b/lib/vssh/wolfssh.c index 000ca457f7..eed73fd919 100644 --- a/lib/vssh/wolfssh.c +++ b/lib/vssh/wolfssh.c @@ -1107,7 +1107,7 @@ static void wssh_sshc_cleanup(struct ssh_conn *sshc) #if 0 static CURLcode wscp_done(struct Curl_easy *data, - CURLcode code, bool premature) + CURLcode code, bool premature) { CURLcode result = CURLE_OK; (void)conn; @@ -1118,7 +1118,7 @@ static CURLcode wscp_done(struct Curl_easy *data, } static CURLcode wscp_doing(struct Curl_easy *data, - bool *dophase_done) + bool *dophase_done) { CURLcode result = CURLE_OK; (void)conn; @@ -1140,7 +1140,7 @@ static CURLcode wscp_disconnect(struct Curl_easy *data, #endif static CURLcode wsftp_done(struct Curl_easy *data, - CURLcode code, bool premature) + CURLcode code, bool premature) { struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); (void)premature; @@ -1153,7 +1153,7 @@ static CURLcode wsftp_done(struct Curl_easy *data, } static CURLcode wsftp_doing(struct Curl_easy *data, - bool *dophase_done) + bool *dophase_done) { CURLcode result = wssh_multi_statemach(data, dophase_done); diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 8186fc7be4..a2d093baef 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -783,9 +783,9 @@ static int gtls_handshake_cb(gnutls_session_t session, unsigned int htype, } static CURLcode gtls_set_priority(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct gtls_ctx *gtls, - const char *priority) + struct Curl_easy *data, + struct gtls_ctx *gtls, + const char *priority) { struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); struct dynbuf buf; diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 7071df88d9..77688d4e5b 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -201,7 +201,7 @@ static ssize_t tls_recv_more(struct Curl_cfilter *cf, */ static CURLcode cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data, - char *plainbuf, size_t plainlen, size_t *pnread) + char *plainbuf, size_t plainlen, size_t *pnread) { const struct ssl_connect_data *const connssl = cf->ctx; struct rustls_ssl_backend_data *const backend = diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 65ba9df0c4..db4e57342e 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -486,7 +486,7 @@ static void cf_ctx_free(struct ssl_connect_data *ctx) } CURLcode Curl_ssl_get_channel_binding(struct Curl_easy *data, int sockindex, - struct dynbuf *binding) + struct dynbuf *binding) { if(Curl_ssl->get_channel_binding) return Curl_ssl->get_channel_binding(data, sockindex, binding); @@ -500,7 +500,7 @@ void Curl_ssl_close_all(struct Curl_easy *data) } void Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, - struct easy_pollset *ps) + struct easy_pollset *ps) { struct ssl_connect_data *connssl = cf->ctx; @@ -891,8 +891,8 @@ static CURLcode multissl_connect(struct Curl_cfilter *cf, } static void multissl_adjust_pollset(struct Curl_cfilter *cf, - struct Curl_easy *data, - struct easy_pollset *ps) + struct Curl_easy *data, + struct easy_pollset *ps) { if(multissl_setup(NULL)) return; diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index a6cf4e0e74..c62b8ae258 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -207,7 +207,7 @@ bool Curl_ssl_cert_status_request(void); * returned. */ CURLcode Curl_ssl_get_channel_binding(struct Curl_easy *data, int sockindex, - struct dynbuf *binding); + struct dynbuf *binding); #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */ diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index aaa830bb19..662539cd89 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -373,9 +373,9 @@ void Curl_ssl_scache_unlock(struct Curl_easy *data) } static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf, - const char *name, - char *path, - bool *is_local) + const char *name, + char *path, + bool *is_local) { if(path && path[0]) { /* We try to add absolute paths, so that the session key can stay @@ -407,8 +407,8 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf, } static CURLcode cf_ssl_peer_key_add_hash(struct dynbuf *buf, - const char *name, - struct curl_blob *blob) + const char *name, + struct curl_blob *blob) { CURLcode r = CURLE_OK; if(blob && blob->len) { @@ -865,9 +865,9 @@ CURLcode Curl_ssl_scache_put(struct Curl_cfilter *cf, } void Curl_ssl_scache_return(struct Curl_cfilter *cf, - struct Curl_easy *data, - const char *ssl_peer_key, - struct Curl_ssl_session *s) + struct Curl_easy *data, + const char *ssl_peer_key, + struct Curl_ssl_session *s) { /* See RFC 8446 C.4: * "Clients SHOULD NOT reuse a ticket for multiple connections." */ diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index 7647ad46ee..aa0930e3fc 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -589,7 +589,7 @@ CURLcode Curl_x509_GTime2str(struct dynbuf *store, * Return error code. */ static CURLcode UTime2str(struct dynbuf *store, - const char *beg, const char *end) + const char *beg, const char *end) { const char *tzp; size_t tzl; diff --git a/src/tool_setup.h b/src/tool_setup.h index c744ea6b72..a661040737 100644 --- a/src/tool_setup.h +++ b/src/tool_setup.h @@ -58,16 +58,16 @@ extern FILE *tool_stderr; #endif #ifndef CURL_OS -# define CURL_OS "unknown" +#define CURL_OS "unknown" #endif #ifndef UNPRINTABLE_CHAR - /* define what to use for unprintable characters */ -# define UNPRINTABLE_CHAR '.' +/* define what to use for unprintable characters */ +#define UNPRINTABLE_CHAR '.' #endif #ifndef HAVE_STRDUP -# include "tool_strdup.h" +#include "tool_strdup.h" #endif #ifndef tool_nop_stmt @@ -78,7 +78,7 @@ extern FILE *tool_stderr; # define CURL_STRICMP(p1, p2) _stricmp(p1, p2) #elif defined(HAVE_STRCASECMP) # ifdef HAVE_STRINGS_H -# include +# include # endif # define CURL_STRICMP(p1, p2) strcasecmp(p1, p2) #elif defined(HAVE_STRCMPI) @@ -115,5 +115,4 @@ int tool_ftruncate64(int fd, curl_off_t where); #endif /* ! HAVE_FTRUNCATE */ #endif /* _WIN32 */ - #endif /* HEADER_CURL_TOOL_SETUP_H */ diff --git a/tests/devtest.pl b/tests/devtest.pl index 4fb0934e98..168e00ec94 100755 --- a/tests/devtest.pl +++ b/tests/devtest.pl @@ -75,7 +75,7 @@ my $is_wsl = $uname_release =~ /Microsoft$/; sub logmsg { for(@_) { my $line = $_; - if ($is_wsl) { + if($is_wsl) { # use \r\n for WSL shell $line =~ s/\r?\n$/\r\n/g; } diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 6db08b4843..927d4c66a3 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -675,7 +675,7 @@ sub disc_handshake { print DWRITE "DISC\n"; my $line; my $nr; - while (5 == ($nr = sysread DREAD, $line, 5)) { + while(5 == ($nr = sysread DREAD, $line, 5)) { if($line eq "DATA\n") { # Must read the data bytes to stay in sync my $i; @@ -844,7 +844,7 @@ sub MAIL_smtp { logmsg "MAIL_smtp got $args\n"; - if (!$args) { + if(!$args) { sendcontrol "501 Unrecognized parameter\r\n"; } else { @@ -864,15 +864,15 @@ sub MAIL_smtp { } # this server doesn't "validate" MAIL FROM addresses - if (length($from)) { + if(length($from)) { my @found; my $valid = 1; # Check the capabilities for SIZE and if the specified size is # greater than the message size then reject it - if (@found = grep /^SIZE (\d+)$/, @capabilities) { - if ($found[0] =~ /^SIZE (\d+)$/) { - if ($size > $1) { + if(@found = grep /^SIZE (\d+)$/, @capabilities) { + if($found[0] =~ /^SIZE (\d+)$/) { + if($size > $1) { $valid = 0; } } @@ -908,10 +908,10 @@ sub RCPT_smtp { # Validate the to address (only a valid email address inside <> is # allowed, such as ) - if ((!$smtputf8 && $to =~ - /^<([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})>$/) || - ($smtputf8 && $to =~ - /^<([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4})>$/)) { + if((!$smtputf8 && $to =~ + /^<([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})>$/) || + ($smtputf8 && $to =~ + /^<([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4})>$/)) { sendcontrol "250 Recipient OK\r\n"; } else { @@ -925,10 +925,10 @@ sub RCPT_smtp { sub DATA_smtp { my ($args) = @_; - if ($args) { + if($args) { sendcontrol "501 Unrecognized parameter\r\n"; } - elsif ($smtp_client !~ /^(\d*)$/) { + elsif($smtp_client !~ /^(\d*)$/) { sendcontrol "501 Invalid arguments\r\n"; } else { @@ -946,7 +946,7 @@ sub DATA_smtp { my $ulsize=0; my $disc=0; my $raw; - while (5 == (sysread \*SFREAD, $line, 5)) { + while(5 == (sysread \*SFREAD, $line, 5)) { if($line eq "DATA\n") { my $i; my $eob; @@ -1074,16 +1074,16 @@ sub VRFY_smtp { # Validate the username (only a valid local or external username is # allowed, such as user or user@example.com) - if ((!$smtputf8 && $username =~ - /^([a-zA-Z0-9._%+-]+)(\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4}))?$/) || - ($smtputf8 && $username =~ - /^([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)(\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4}))?$/)) { + if((!$smtputf8 && $username =~ + /^([a-zA-Z0-9._%+-]+)(\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4}))?$/) || + ($smtputf8 && $username =~ + /^([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)(\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4}))?$/)) { my @data = getreplydata($smtp_client); if(!@data) { - if ($username !~ - /^([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})$/) { + if($username !~ + /^([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})$/) { push @data, "250 <$username\@example.com>\r\n" } else { @@ -1184,7 +1184,7 @@ sub LOGIN_imap { logmsg "LOGIN_imap got $args\n"; - if ($user eq "") { + if($user eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1227,7 +1227,7 @@ sub FETCH_imap { logmsg "FETCH_imap got $args\n"; - if ($selected eq "") { + if($selected eq "") { sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; } else { @@ -1355,10 +1355,10 @@ sub STORE_imap { logmsg "STORE_imap got $args\n"; - if ($selected eq "") { + if($selected eq "") { sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; } - elsif (($uid eq "") || ($what ne "+Flags") || ($value eq "")) { + elsif(($uid eq "") || ($what ne "+Flags") || ($value eq "")) { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1380,10 +1380,10 @@ sub LIST_imap { logmsg "LIST_imap got $args\n"; - if ($reference eq "") { + if($reference eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } - elsif ($reference eq "verifiedserver") { + elsif($reference eq "verifiedserver") { # this is the secret command that verifies that this actually is # the curl test server sendcontrol "* LIST () \"/\" \"WE ROOLZ: $$\"\r\n"; @@ -1415,7 +1415,7 @@ sub LSUB_imap { logmsg "LSUB_imap got $args\n"; - if ($reference eq "") { + if($reference eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1437,7 +1437,7 @@ sub EXAMINE_imap { logmsg "EXAMINE_imap got $mailbox\n"; - if ($mailbox eq "") { + if($mailbox eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1460,7 +1460,7 @@ sub STATUS_imap { logmsg "STATUS_imap got $args\n"; - if ($mailbox eq "") { + if($mailbox eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1482,10 +1482,10 @@ sub SEARCH_imap { logmsg "SEARCH_imap got $what\n"; - if ($selected eq "") { + if($selected eq "") { sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; } - elsif ($what eq "") { + elsif($what eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1507,7 +1507,7 @@ sub CREATE_imap { logmsg "CREATE_imap got $args\n"; - if ($args eq "") { + if($args eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1523,7 +1523,7 @@ sub DELETE_imap { logmsg "DELETE_imap got $args\n"; - if ($args eq "") { + if($args eq "") { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1540,7 +1540,7 @@ sub RENAME_imap { logmsg "RENAME_imap got $args\n"; - if (($from_mailbox eq "") || ($to_mailbox eq "")) { + if(($from_mailbox eq "") || ($to_mailbox eq "")) { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1551,7 +1551,7 @@ sub RENAME_imap { } sub CHECK_imap { - if ($selected eq "") { + if($selected eq "") { sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; } else { @@ -1562,10 +1562,10 @@ sub CHECK_imap { } sub CLOSE_imap { - if ($selected eq "") { + if($selected eq "") { sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; } - elsif (!@deleted) { + elsif(!@deleted) { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1578,11 +1578,11 @@ sub CLOSE_imap { } sub EXPUNGE_imap { - if ($selected eq "") { + if($selected eq "") { sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; } else { - if (!@deleted) { + if(!@deleted) { # Report the number of existing messages as per the SELECT # command sendcontrol "* 172 EXISTS\r\n"; @@ -1609,7 +1609,7 @@ sub COPY_imap { logmsg "COPY_imap got $args\n"; - if (($uid eq "") || ($mailbox eq "")) { + if(($uid eq "") || ($mailbox eq "")) { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1633,17 +1633,17 @@ sub UID_imap { logmsg "UID_imap got $args\n"; - if ($selected eq "") { + if($selected eq "") { sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; } - elsif (substr($command, 0, 5) eq "FETCH"){ + elsif(substr($command, 0, 5) eq "FETCH"){ my $func = $commandfunc{"FETCH"}; if($func) { &$func($args, $command); } } - elsif (($command ne "COPY") && - ($command ne "STORE") && ($command ne "SEARCH")) { + elsif(($command ne "COPY") && + ($command ne "STORE") && ($command ne "SEARCH")) { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1668,7 +1668,7 @@ sub NOOP_imap { "* 14 FETCH (FLAGS (\\Seen \\Deleted))\r\n", ); - if ($args) { + if($args) { sendcontrol "$cmdid BAD Command Argument\r\n"; } else { @@ -1750,16 +1750,16 @@ sub APOP_pop3 { my ($args) = @_; my ($user, $secret) = split(/ /, $args, 2); - if (!grep /^APOP$/, @capabilities) { + if(!grep /^APOP$/, @capabilities) { sendcontrol "-ERR Unrecognized command\r\n"; } - elsif (($user eq "") || ($secret eq "")) { + elsif(($user eq "") || ($secret eq "")) { sendcontrol "-ERR Protocol error\r\n"; } else { my $digest = Digest::MD5::md5_hex($POP3_TIMESTAMP, $TEXT_PASSWORD); - if ($secret ne $digest) { + if($secret ne $digest) { sendcontrol "-ERR Login failure\r\n"; } else { @@ -1801,7 +1801,7 @@ sub USER_pop3 { logmsg "USER_pop3 got $user\n"; - if (!$user) { + if(!$user) { sendcontrol "-ERR Protocol error\r\n"; } else { @@ -1879,7 +1879,7 @@ sub DELE_pop3 { logmsg "DELE_pop3 got $msgid\n"; - if (!$msgid) { + if(!$msgid) { sendcontrol "-ERR Protocol error\r\n"; } else { @@ -1894,7 +1894,7 @@ sub DELE_pop3 { sub STAT_pop3 { my ($args) = @_; - if ($args) { + if($args) { sendcontrol "-ERR Protocol error\r\n"; } else { @@ -1909,7 +1909,7 @@ sub STAT_pop3 { sub NOOP_pop3 { my ($args) = @_; - if ($args) { + if($args) { sendcontrol "-ERR Protocol error\r\n"; } else { @@ -1927,7 +1927,7 @@ sub UIDL_pop3 { "3 4\r\n", # Note that UID 3 is a simulated "deleted" message ); - if (!grep /^UIDL$/, @capabilities) { + if(!grep /^UIDL$/, @capabilities) { sendcontrol "-ERR Unrecognized command\r\n"; } else { @@ -1952,14 +1952,14 @@ sub TOP_pop3 { logmsg "TOP_pop3 got $args\n"; - if (!grep /^TOP$/, @capabilities) { + if(!grep /^TOP$/, @capabilities) { sendcontrol "-ERR Unrecognized command\r\n"; } - elsif (($msgid eq "") || ($lines eq "")) { + elsif(($msgid eq "") || ($lines eq "")) { sendcontrol "-ERR Protocol error\r\n"; } else { - if ($lines == "0") { + if($lines == "0") { logmsg "retrieve header of mail\n"; } else { @@ -1986,11 +1986,11 @@ sub TOP_pop3 { sub RSET_pop3 { my ($args) = @_; - if ($args) { + if($args) { sendcontrol "-ERR Protocol error\r\n"; } else { - if (@deleted) { + if(@deleted) { logmsg "resetting @deleted message(s)\n"; @deleted = (); @@ -2167,7 +2167,7 @@ sub NLST_ftp { sub MDTM_ftp { my $testno = $_[0]; my $testpart = ""; - if ($testno > 10000) { + if($testno > 10000) { $testpart = $testno % 10000; $testno = int($testno / 10000); } @@ -2310,7 +2310,7 @@ sub RETR_ftp { $testno =~ s/^([^0-9]*)//; my $testpart = ""; - if ($testno > 10000) { + if($testno > 10000) { $testpart = $testno % 10000; $testno = int($testno / 10000); } @@ -2404,7 +2404,7 @@ sub STOR_ftp { my $line; my $ulsize=0; my $disc=0; - while (5 == (sysread DREAD, $line, 5)) { + while(5 == (sysread DREAD, $line, 5)) { if($line eq "DATA\n") { my $i; sysread DREAD, $i, 5; @@ -2605,7 +2605,7 @@ sub PASV_ftp { } alarm 0; }; - if ($@) { + if($@) { # timed out logmsg "$srvrname server timed out awaiting data connection ". "on port $pasvport\n"; diff --git a/tests/getpart.pm b/tests/getpart.pm index a15a4189db..3f9ecbb5af 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -366,7 +366,7 @@ sub loadarray { my ($filename)=@_; my @array; - if (open(my $temp, "<", "$filename")) { + if(open(my $temp, "<", "$filename")) { while(<$temp>) { push @array, $_; } diff --git a/tests/libtest/test1013.pl b/tests/libtest/test1013.pl index 6d10a3223a..79a6de409d 100755 --- a/tests/libtest/test1013.pl +++ b/tests/libtest/test1013.pl @@ -24,8 +24,7 @@ ########################################################################### # Determine if curl-config --protocols/--features matches the # curl --version protocols/features -if ( $#ARGV != 2 ) -{ +if($#ARGV != 2) { print "Usage: $0 curl-config-script curl-version-output-file features|protocols\n"; exit 3; } @@ -35,8 +34,7 @@ my $what=$ARGV[2]; # Read the output of curl --version my $curl_protocols=""; open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n"; -while( ) -{ +while() { $curl_protocols = $_ if ( /$what:/i ); } close CURL; @@ -48,8 +46,7 @@ $curl_protocols =~ /\w+: (.*)$/; # Read the output of curl-config my @curl_config; open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config $what list\n"; -while( ) -{ +while() { chomp; $_ = lc($_) if($what eq "protocols"); # accept uppercase protocols in curl-config push @curl_config, $_; @@ -66,7 +63,7 @@ my $curlproto = join ' ', @curl; my $curlconfigproto = join ' ', @curl_config; my $different = $curlproto ne $curlconfigproto; -if ($different) { +if($different) { print "Mismatch in $what lists:\n"; print "curl: $curlproto\n"; print "curl-config: $curlconfigproto\n"; diff --git a/tests/libtest/test1022.pl b/tests/libtest/test1022.pl index 5c5c02070f..4427d633b5 100755 --- a/tests/libtest/test1022.pl +++ b/tests/libtest/test1022.pl @@ -23,8 +23,7 @@ # ########################################################################### # Determine if curl-config --version matches the curl --version -if ( $#ARGV != 2 ) -{ +if($#ARGV != 2) { print "Usage: $0 curl-config-script curl-version-output-file version|vernum\n"; exit 3; } @@ -46,7 +45,7 @@ open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config --$what l $_ = ; chomp; my $filever=$_; -if ( $what eq "version" ) { +if($what eq "version") { if($filever =~ /^libcurl ([\.\d]+((-DEV)|(-rc\d)|(-\d+))?)$/) { $curlconfigversion = $1; } @@ -69,7 +68,7 @@ else { # "vernum" case close CURLCONFIG; my $different = $version ne $curlconfigversion; -if ($different || !$version) { +if($different || !$version) { print "Mismatch in --version:\n"; print "curl: $version\n"; print "curl-config: $curlconfigversion\n"; diff --git a/tests/libtest/test307.pl b/tests/libtest/test307.pl index 862f0e9729..ea54b59824 100755 --- a/tests/libtest/test307.pl +++ b/tests/libtest/test307.pl @@ -23,19 +23,16 @@ # ########################################################################### # Determine if the given curl executable supports the 'openssl' SSL engine -if ( $#ARGV != 0 ) -{ +if($#ARGV != 0) { print "Usage: $0 curl-executable\n"; exit 3; } -if (!open(CURL, "@ARGV[0] -s --engine list|")) -{ +if(!open(CURL, "@ARGV[0] -s --engine list|")) { print "Can't get SSL engine list\n"; exit 2; } -while( ) -{ - exit 0 if ( /openssl/ ); +while() { + exit 0 if(/openssl/); } close CURL; print "openssl engine not supported\n"; diff --git a/tests/libtest/test610.pl b/tests/libtest/test610.pl index 0ef9330684..b37c25286a 100755 --- a/tests/libtest/test610.pl +++ b/tests/libtest/test610.pl @@ -23,8 +23,7 @@ # ########################################################################### # Perform simple file and directory manipulation in a portable way -if ( $#ARGV <= 0 ) -{ +if($#ARGV <= 0) { print "Usage: $0 mkdir|rmdir|rm|move|gone path1 [path2] [more commands...]\n"; exit 1; } @@ -33,20 +32,20 @@ use File::Copy; while(@ARGV) { my $cmd = shift @ARGV; my $arg = shift @ARGV; - if ($cmd eq "mkdir") { + if($cmd eq "mkdir") { mkdir $arg || die "$!"; } - elsif ($cmd eq "rmdir") { + elsif($cmd eq "rmdir") { rmdir $arg || die "$!"; } - elsif ($cmd eq "rm") { + elsif($cmd eq "rm") { unlink $arg || die "$!"; } - elsif ($cmd eq "move") { + elsif($cmd eq "move") { my $arg2 = shift @ARGV; move($arg,$arg2) || die "$!"; } - elsif ($cmd eq "gone") { + elsif($cmd eq "gone") { ! -e $arg || die "Path $arg exists"; } else { print "Unsupported command $cmd\n"; diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index 2d4f390f77..bff7b9ddb2 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -25,8 +25,7 @@ # Prepare a directory with known files and clean up afterwards use Time::Local; -if ( $#ARGV < 1 ) -{ +if($#ARGV < 1) { print "Usage: $0 prepare|postprocess dir [logfile]\n"; exit 1; } @@ -37,7 +36,7 @@ sub errout { exit 1; } -if ($ARGV[0] eq "prepare") +if($ARGV[0] eq "prepare") { my $dirname = $ARGV[1]; mkdir $dirname || errout "$!"; @@ -72,7 +71,7 @@ if ($ARGV[0] eq "prepare") exit 0; } -elsif ($ARGV[0] eq "postprocess") +elsif($ARGV[0] eq "postprocess") { my $dirname = $ARGV[1]; my $logfile = $ARGV[2]; @@ -88,7 +87,7 @@ elsif ($ARGV[0] eq "postprocess") rmdir $dirname || die "$!"; - if ($logfile && -s $logfile) { + if($logfile && -s $logfile) { # Process the directory file to remove all information that # could be inconsistent from one test run to the next (e.g. # file date) or may be unsupported on some platforms (e.g. @@ -105,18 +104,18 @@ elsif ($ARGV[0] eq "postprocess") my @canondir; open(IN, "<$logfile") || die "$!"; - while () { + while() { /^(.)(..).(..).(..).\s*(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+\s+\S+\s+\S+)\s+(.*)$/; - if ($1 eq "d") { + if($1 eq "d") { # Skip current and parent directory listing, because some SSH # servers (eg. OpenSSH for Windows) are not listing those - if ($8 eq "." || $8 eq "..") { + if($8 eq "." || $8 eq "..") { next; } # Erase all directory metadata except for the name, as it is not # consistent for across all test systems and filesystems push @canondir, "d????????? N U U N ??? N NN:NN $8\n"; - } elsif ($1 eq "-") { + } elsif($1 eq "-") { # Ignore group and other permissions, because these may vary on # some systems (e.g. on Windows) # Erase user and group names, as they are not consistent across diff --git a/tests/pathhelp.pm b/tests/pathhelp.pm index fcf4e9e962..571a4d5a67 100644 --- a/tests/pathhelp.pm +++ b/tests/pathhelp.pm @@ -170,14 +170,14 @@ sub build_sys_abs_path { # sub exe_ext { my ($component, @arr) = @_; - if ($ENV{'CURL_TEST_EXE_EXT'}) { + if($ENV{'CURL_TEST_EXE_EXT'}) { return $ENV{'CURL_TEST_EXE_EXT'}; } - if ($ENV{'CURL_TEST_EXE_EXT_'.$component}) { + if($ENV{'CURL_TEST_EXE_EXT_'.$component}) { return $ENV{'CURL_TEST_EXE_EXT_'.$component}; } - if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' || - $^O eq 'dos' || $^O eq 'os2') { + if($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' || + $^O eq 'dos' || $^O eq 'os2') { return '.exe'; } return ''; diff --git a/tests/processhelp.pm b/tests/processhelp.pm index 3919c29bbd..571ed5b34d 100644 --- a/tests/processhelp.pm +++ b/tests/processhelp.pm @@ -78,7 +78,7 @@ sub portable_sleep { if($Time::HiRes::VERSION) { Time::HiRes::sleep($seconds); } - elsif (os_is_win()) { + elsif(os_is_win()) { Win32::Sleep($seconds*1000); } else { @@ -138,7 +138,7 @@ sub pidexists { if($pid > 0) { # verify if currently existing Windows process $pid = winpid_to_pid($pid); - if ($pid > 4194304 && os_is_win()) { + if($pid > 4194304 && os_is_win()) { $pid -= 4194304; if($^O ne 'MSWin32') { my $filter = "PID eq $pid"; @@ -169,7 +169,7 @@ sub pidterm { if($pid > 0) { # request the process to quit $pid = winpid_to_pid($pid); - if ($pid > 4194304 && os_is_win()) { + if($pid > 4194304 && os_is_win()) { $pid -= 4194304; if($^O ne 'MSWin32') { # https://ss64.com/nt/taskkill.html @@ -194,7 +194,7 @@ sub pidkill { if($pid > 0) { # request the process to quit $pid = winpid_to_pid($pid); - if ($pid > 4194304 && os_is_win()) { + if($pid > 4194304 && os_is_win()) { $pid -= 4194304; if($^O ne 'MSWin32') { # https://ss64.com/nt/taskkill.html @@ -219,7 +219,7 @@ sub pidwait { $pid = winpid_to_pid($pid); # check if the process exists - if ($pid > 4194304 && os_is_win()) { + if($pid > 4194304 && os_is_win()) { if($flags == &WNOHANG) { return pidexists($pid)?0:$pid; } diff --git a/tests/runner.pm b/tests/runner.pm index 4df57730e2..9ebee05988 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -249,7 +249,7 @@ sub runner_init { ####################################################################### # Loop to execute incoming IPC calls until the shutdown call sub event_loop { - while () { + while() { if(ipcrecv()) { last; } @@ -607,7 +607,7 @@ sub singletest_startservers { my $why; my $error; - if (!$listonly) { + if(!$listonly) { my @what = getpart("client", "server"); if(!$what[0]) { warn "Test case $testnum has no server(s) specified"; @@ -779,7 +779,7 @@ sub singletest_prepare { mkdir $d; # 0777 } } - if (open(my $outfile, ">", "$filename")) { + if(open(my $outfile, ">", "$filename")) { binmode $outfile; # for crapage systems, use binary if($fileattr{'nonewline'}) { # cut off the final newline @@ -820,7 +820,7 @@ sub singletest_run { my %cmdhash = getpartattr("client", "command"); if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) { #We may slap on --output! - if (!partexists("verify", "stdout") || + if(!partexists("verify", "stdout") || ($cmdhash{'option'} && $cmdhash{'option'} =~ /force-output/)) { $out=" --output $CURLOUT "; } @@ -887,7 +887,7 @@ sub singletest_run { } } $cmdargs .= $cmd; - if ($proxy_address) { + if($proxy_address) { $cmdargs .= " --proxy $proxy_address "; } } @@ -1015,7 +1015,7 @@ sub singletest_run { $$testtimings{"timetoolini"} = Time::HiRes::time(); # run the command line we built - if ($torture) { + if($torture) { $cmdres = torture($CMDLINE, $testnum, "$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " -x $LOGDIR/gdbcmd"); @@ -1197,7 +1197,7 @@ sub runner_test_preprocess { ############################################################### # Check that the test environment is fine to run this test case - if (!$listonly) { + if(!$listonly) { $why = singletest_precheck($testnum); $error = -1; } diff --git a/tests/runtests.pl b/tests/runtests.pl index 39e9bca3f7..37efc2a49b 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -202,7 +202,7 @@ sub logmsg { if(!$line) { next; } - if ($is_wsl) { + if($is_wsl) { # use \r\n for WSL shell $line =~ s/\r?\n$/\r\n/g; } @@ -303,7 +303,7 @@ delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'}); # provide defaults from our config file for ENV vars not explicitly # set by the caller -if (open(my $fd, "<", "config")) { +if(open(my $fd, "<", "config")) { while(my $line = <$fd>) { next if ($line =~ /^#/); chomp $line; @@ -315,10 +315,10 @@ if (open(my $fd, "<", "config")) { # Check if we have nghttpx available and if it talks http/3 my $nghttpx_h3 = 0; -if (!$ENV{"NGHTTPX"}) { +if(!$ENV{"NGHTTPX"}) { $ENV{"NGHTTPX"} = checktestcmd("nghttpx"); } -if ($ENV{"NGHTTPX"}) { +if($ENV{"NGHTTPX"}) { my $cmd = "\"$ENV{'NGHTTPX'}\" -v 2>$dev_null"; my $nghttpx_version=join(' ', `$cmd`); $nghttpx_h3 = $nghttpx_version =~ /nghttp3\//; @@ -551,65 +551,65 @@ sub checksystemfeatures { $pwd = sys_native_current_path(); $feature{"win32"} = 1; } - if ($libcurl =~ /\sschannel\b/i) { + if($libcurl =~ /\sschannel\b/i) { $feature{"Schannel"} = 1; $feature{"SSLpinning"} = 1; } - elsif ($libcurl =~ /\sopenssl\b/i) { + elsif($libcurl =~ /\sopenssl\b/i) { $feature{"OpenSSL"} = 1; $feature{"SSLpinning"} = 1; } - elsif ($libcurl =~ /\sgnutls\b/i) { + elsif($libcurl =~ /\sgnutls\b/i) { $feature{"GnuTLS"} = 1; $feature{"SSLpinning"} = 1; } - elsif ($libcurl =~ /\srustls-ffi\b/i) { + elsif($libcurl =~ /\srustls-ffi\b/i) { $feature{"rustls"} = 1; } - elsif ($libcurl =~ /\swolfssl\b/i) { + elsif($libcurl =~ /\swolfssl\b/i) { $feature{"wolfssl"} = 1; $feature{"SSLpinning"} = 1; } - elsif ($libcurl =~ /\s(BoringSSL|AWS-LC)\b/i) { + elsif($libcurl =~ /\s(BoringSSL|AWS-LC)\b/i) { # OpenSSL compatible API $feature{"OpenSSL"} = 1; $feature{"SSLpinning"} = 1; } - elsif ($libcurl =~ /\slibressl\b/i) { + elsif($libcurl =~ /\slibressl\b/i) { # OpenSSL compatible API $feature{"OpenSSL"} = 1; $feature{"SSLpinning"} = 1; } - elsif ($libcurl =~ /\squictls\b/i) { + elsif($libcurl =~ /\squictls\b/i) { # OpenSSL compatible API $feature{"OpenSSL"} = 1; $feature{"SSLpinning"} = 1; } - elsif ($libcurl =~ /\smbedTLS\b/i) { + elsif($libcurl =~ /\smbedTLS\b/i) { $feature{"mbedtls"} = 1; $feature{"SSLpinning"} = 1; } - if ($libcurl =~ /ares/i) { + if($libcurl =~ /ares/i) { $feature{"c-ares"} = 1; $resolver="c-ares"; } - if ($libcurl =~ /nghttp2/i) { + if($libcurl =~ /nghttp2/i) { # nghttp2 supports h2c $feature{"h2c"} = 1; } - if ($libcurl =~ /AppleIDN/) { + if($libcurl =~ /AppleIDN/) { $feature{"AppleIDN"} = 1; } - if ($libcurl =~ /WinIDN/) { + if($libcurl =~ /WinIDN/) { $feature{"WinIDN"} = 1; } - if ($libcurl =~ /libidn2/) { + if($libcurl =~ /libidn2/) { $feature{"libidn2"} = 1; } - if ($libcurl =~ /libssh2/i) { + if($libcurl =~ /libssh2/i) { $feature{"libssh2"} = 1; } - if ($libcurl =~ /libssh\/([0-9.]*)\//i) { + if($libcurl =~ /libssh\/([0-9.]*)\//i) { $feature{"libssh"} = 1; if($1 =~ /(\d+)\.(\d+).(\d+)/) { my $v = $1 * 100 + $2 * 10 + $3; @@ -619,7 +619,7 @@ sub checksystemfeatures { } } } - if ($libcurl =~ /wolfssh/i) { + if($libcurl =~ /wolfssh/i) { $feature{"wolfssh"} = 1; } } @@ -734,11 +734,11 @@ sub checksystemfeatures { logmsg "unable to get curl's version, further details are:\n"; logmsg "issued command: \n"; logmsg "$versioncmd \n"; - if ($versretval == -1) { + if($versretval == -1) { logmsg "command failed with: \n"; logmsg "$versnoexec \n"; } - elsif ($versretval & 127) { + elsif($versretval & 127) { logmsg sprintf("command died with signal %d, and %s coredump.\n", ($versretval & 127), ($versretval & 128)?"a":"no"); } @@ -821,7 +821,7 @@ sub checksystemfeatures { die "can't run torture tests since curl was built without ". "TrackMemory feature (--enable-curldebug)"; } - if ($feature{"threaded-resolver"} && !$valgrind) { + if($feature{"threaded-resolver"} && !$valgrind) { die "can't run torture tests since curl was built with the ". "threaded resolver, and we aren't running with valgrind"; } @@ -1121,25 +1121,25 @@ sub singletest_shouldrun { my $match; for my $k (@info_keywords) { chomp $k; - if ($disabled_keywords{lc($k)}) { - if ($k =~ /^feat:/) { + if($disabled_keywords{lc($k)}) { + if($k =~ /^feat:/) { $why = "disabled by feature"; } else { $why = "disabled by keyword"; } } - elsif ($enabled_keywords{lc($k)}) { + elsif($enabled_keywords{lc($k)}) { $match = 1; } - if ($ignored_keywords{lc($k)}) { + if($ignored_keywords{lc($k)}) { logmsg "Warning: test$testnum result is ignored due to $k\n"; $errorreturncode = 2; } } if(!$why && !$match && %enabled_keywords) { - if (grep { /^feat:/ } keys %enabled_keywords) { + if(grep { /^feat:/ } keys %enabled_keywords) { $why = "disabled by missing feature"; } else { @@ -1149,24 +1149,24 @@ sub singletest_shouldrun { } } - if (!$why && defined $custom_skip_reasons{test}{$testnum}) { + if(!$why && defined $custom_skip_reasons{test}{$testnum}) { $why = $custom_skip_reasons{test}{$testnum}; } - if (!$why && defined $custom_skip_reasons{tool}) { + if(!$why && defined $custom_skip_reasons{tool}) { foreach my $tool (getpart("client", "tool")) { foreach my $tool_skip_pattern (keys %{$custom_skip_reasons{tool}}) { - if ($tool =~ /$tool_skip_pattern/i) { + if($tool =~ /$tool_skip_pattern/i) { $why = $custom_skip_reasons{tool}{$tool_skip_pattern}; } } } } - if (!$why && defined $custom_skip_reasons{keyword}) { + if(!$why && defined $custom_skip_reasons{keyword}) { foreach my $keyword (@info_keywords) { foreach my $keyword_skip_pattern (keys %{$custom_skip_reasons{keyword}}) { - if ($keyword =~ /$keyword_skip_pattern/i) { + if($keyword =~ /$keyword_skip_pattern/i) { $why = $custom_skip_reasons{keyword}{$keyword_skip_pattern}; } } @@ -1225,7 +1225,7 @@ sub singletest_check { my ($runnerid, $testnum, $cmdres, $CURLOUT, $tool, $usedvalgrind)=@_; # Skip all the verification on torture tests - if ($torture) { + if($torture) { # timestamp test result verification end $timevrfyend{$testnum} = Time::HiRes::time(); return -2; @@ -1247,7 +1247,7 @@ sub singletest_check { my %hash = getpartattr("verify", "stdout"); my $loadfile = $hash{'loadfile'}; - if ($loadfile) { + if($loadfile) { open(my $tmp, "<", "$loadfile") || die "Cannot open file $loadfile: $!"; @validstdout = <$tmp>; close($tmp); @@ -1256,7 +1256,7 @@ sub singletest_check { s/\r\n/\n/g for @validstdout; } - if (@validstdout) { + if(@validstdout) { # verify redirected stdout my @actual = loadarray(stdoutfilename($logdir, $testnum)); @@ -1302,7 +1302,7 @@ sub singletest_check { } my @validstderr = getpart("verify", "stderr"); - if (@validstderr) { + if(@validstderr) { # verify redirected stderr my @actual = loadarray(stderrfilename($logdir, $testnum)); @@ -1412,7 +1412,7 @@ sub singletest_check { my %replyattr = getpartattr("reply", "data"); my @reply; - if (partexists("reply", "datacheck")) { + if(partexists("reply", "datacheck")) { for my $partsuffix (('', '1', '2', '3', '4')) { my @replycheckpart = getpart("reply", "datacheck".$partsuffix); if(@replycheckpart) { @@ -1463,7 +1463,7 @@ sub singletest_check { normalize_text(\@out); } $res = compare($runnerid, $testnum, $testname, "data", \@out, \@reply); - if ($res) { + if($res) { return -1; } $ok .= "d"; @@ -1504,7 +1504,7 @@ sub singletest_check { } $res = compare($runnerid, $testnum, $testname, "upload", \@out, \@upload); - if ($res) { + if($res) { return -1; } $ok .= "u"; @@ -1568,7 +1568,7 @@ sub singletest_check { if(!$filename) { logmsg " $testnum: IGNORED: section verify=>file$partsuffix ". "has no name attribute\n"; - if (runnerac_stopservers($runnerid)) { + if(runnerac_stopservers($runnerid)) { logmsg "ERROR: runner $runnerid seems to have died\n"; } else { @@ -1750,10 +1750,10 @@ sub singletest_check { if(@notexists) { # a list of directory entries that must not exist my $err; - while (@notexists) { + while(@notexists) { my $fname = shift @notexists; chomp $fname; - if (-e $fname) { + if(-e $fname) { logmsg "Found '$fname' when not supposed to exist.\n"; $err++; } @@ -2248,16 +2248,16 @@ my $number=0; my $fromnum=-1; my @testthis; while(@ARGV) { - if ($ARGV[0] eq "-v") { + if($ARGV[0] eq "-v") { # verbose output $verbose=1; } - elsif ($ARGV[0] eq "-c") { + elsif($ARGV[0] eq "-c") { # use this path to curl instead of default $DBGCURL=$CURL=$ARGV[1]; shift @ARGV; } - elsif ($ARGV[0] eq "-vc") { + elsif($ARGV[0] eq "-vc") { # use this path to a curl used to verify servers # Particularly useful when you introduce a crashing bug somewhere in @@ -2267,12 +2267,12 @@ while(@ARGV) { $VCURL=shell_quote($ARGV[1]); shift @ARGV; } - elsif ($ARGV[0] eq "-ac") { + elsif($ARGV[0] eq "-ac") { # use this curl only to talk to APIs (currently only CI test APIs) $ACURL=shell_quote($ARGV[1]); shift @ARGV; } - elsif ($ARGV[0] eq "-d") { + elsif($ARGV[0] eq "-d") { # have the servers display protocol output $debugprotocol=1; } @@ -2310,15 +2310,15 @@ while(@ARGV) { } close($fd); } - elsif ($ARGV[0] eq "-g") { + elsif($ARGV[0] eq "-g") { # run this test with gdb $gdbthis=1; } - elsif ($ARGV[0] eq "-gl") { + elsif($ARGV[0] eq "-gl") { # run this test with lldb $gdbthis=2; } - elsif ($ARGV[0] eq "-gw") { + elsif($ARGV[0] eq "-gw") { # run this test with windowed gdb $gdbthis=1; $gdbxwin=1; @@ -2340,7 +2340,7 @@ while(@ARGV) { # disable the valgrind debuginfod functionality $no_debuginfod = 1; } - elsif ($ARGV[0] eq "-R") { + elsif($ARGV[0] eq "-R") { # execute in scrambled order $scrambleorder=1; } @@ -2377,7 +2377,7 @@ while(@ARGV) { } elsif($ARGV[0] eq "-o") { shift @ARGV; - if ($ARGV[0] =~ /^(\w+)=([\w.:\/\[\]-]+)$/) { + if($ARGV[0] =~ /^(\w+)=([\w.:\/\[\]-]+)$/) { my ($variable, $value) = ($1, $2); eval "\$$variable='$value'" or die "Failed to set \$$variable to $value: $@"; } else { @@ -2570,7 +2570,7 @@ if($valgrind) { # (this happened in 2003, so we could probably don't need to care about # that old version any longer and just delete this check) runclient("valgrind --help 2>&1 | grep -- --tool >$dev_null 2>&1"); - if (($? >> 8)) { + if(($? >> 8)) { $valgrind_tool=""; } open(my $curlh, "<", "$CURL"); @@ -2597,7 +2597,7 @@ if($valgrind) { } } -if ($gdbthis) { +if($gdbthis) { # open the executable curl and read the first 4 bytes of it open(my $check, "<", "$CURL"); my $c; @@ -2715,7 +2715,7 @@ sub disabledtests { # If 'all' tests are requested, find out all test numbers # -if ( $TESTCASES eq "all") { +if($TESTCASES eq "all") { # Get all commands and find out their test numbers opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!"; my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR); @@ -2742,7 +2742,7 @@ if ( $TESTCASES eq "all") { else { my $verified=""; for(split(" ", $TESTCASES)) { - if (-e "$TESTDIR/test$_") { + if(-e "$TESTDIR/test$_") { $verified.="$_ "; } } @@ -2792,7 +2792,7 @@ sub displaylogcontent { $string =~ tr/\n//; for my $line (split(m/\n/, $string)) { $line =~ s/\s*\!$//; - if ($truncate) { + if($truncate) { push @tail, " $line\n"; } else { logmsg " $line\n"; @@ -2944,7 +2944,7 @@ else { $retry_left = $retry; } -while () { +while() { # check the abort flag if($globalabort) { logmsg singletest_dumplogs(); diff --git a/tests/servers.pm b/tests/servers.pm index 9a2c57dcdf..c9cc4be24b 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -157,7 +157,7 @@ our $stunnel; # path to stunnel command sub checkcmd { my ($cmd, @extrapaths)=@_; my @paths; - if ($^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'os2') { + if($^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'os2') { # PATH separator is different @paths=(split(';', $ENV{'PATH'}), @extrapaths); } @@ -207,17 +207,17 @@ sub initserverconfig { # get the name of the current user $USER = $ENV{USER}; # Linux - if (!$USER) { + if(!$USER) { $USER = $ENV{USERNAME}; # Windows } - if (!$USER) { + if(!$USER) { $USER = $ENV{LOGNAME}; # Some Unix (I think) } - if (!$USER) { + if(!$USER) { $USER = `whoami`; chomp $USER; } - if (!$USER) { + if(!$USER) { $USER = `id -un`; chomp $USER; } @@ -370,7 +370,7 @@ sub startnew { } # Ugly hack but ssh client and gnutls-serv don't support pid files - if ($fakepidfile) { + if($fakepidfile) { if(open(my $out, ">", "$pidfile")) { print $out $child . "\n"; close($out) || die "Failure writing pidfile"; @@ -381,7 +381,7 @@ sub startnew { } # could/should do a while connect fails sleep a bit and loop portable_sleep($timeout); - if (checkdied($child)) { + if(checkdied($child)) { logmsg "startnew: child process has failed to start\n" if($verbose); return (-1,-1); } @@ -397,7 +397,7 @@ sub startnew { # similar! last; } - if (checkdied($child)) { + if(checkdied($child)) { logmsg "startnew: child process has died, server might start up\n" if($verbose); # We can't just abort waiting for the server with a @@ -1111,7 +1111,7 @@ sub runhttpserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1190,7 +1190,7 @@ sub runhttp2server { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0, 0); } @@ -1251,7 +1251,7 @@ sub runhttp3server { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1317,7 +1317,7 @@ sub runhttpsserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1398,7 +1398,7 @@ sub runhttptlsserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1461,7 +1461,7 @@ sub runpingpongserver { my $portfile = $serverportfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0); } @@ -1532,7 +1532,7 @@ sub runsecureserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1603,7 +1603,7 @@ sub runtftpserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1674,7 +1674,7 @@ sub rundnsserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1747,7 +1747,7 @@ sub runrtspserver { my $portfile = $serverportfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1817,7 +1817,7 @@ sub runsshserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -1935,7 +1935,7 @@ sub runmqttserver { my $portfile = $serverportfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0); } @@ -1997,7 +1997,7 @@ sub runsocksserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2080,7 +2080,7 @@ sub rundictserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2141,7 +2141,7 @@ sub runsmbserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2202,7 +2202,7 @@ sub runnegtelnetserver { my $pidfile = $serverpidfile{$server}; # don't retry if the server doesn't work - if ($doesntrun{$pidfile}) { + if($doesntrun{$pidfile}) { return (2, 0, 0, 0); } @@ -2387,7 +2387,7 @@ sub responsive_httptls_server { my $ip = "$HOSTIP"; my $idnum = 1; - if ($ipvnum == 6) { + if($ipvnum == 6) { $port = protoport("httptls6"); $ip = "$HOST6IP"; } @@ -3173,7 +3173,7 @@ sub subvariables { # this only works after the SSH server has been started # TODO: call sshversioninfo early and store $sshdid so this substitution # always works - if ($sshdid && $sshdid =~ /OpenSSH-Windows/) { + if($sshdid && $sshdid =~ /OpenSSH-Windows/) { $ssh_pwd = $file_pwd; } diff --git a/tests/sshserver.pl b/tests/sshserver.pl index 4e0ca466c5..98c15bc2a9 100755 --- a/tests/sshserver.pl +++ b/tests/sshserver.pl @@ -482,7 +482,7 @@ my $hstprvkeyf_config; my $pidfile_config; my $sftpsrv_config; my $sshdconfig_abs; -if ($sshdid =~ /OpenSSH-Windows/) { +if($sshdid =~ /OpenSSH-Windows/) { # Ensure to use native Windows paths with OpenSSH for Windows $clipubkeyf_config = pathhelp::sys_native_abs_path(pp($clipubkeyf)); $hstprvkeyf_config = pathhelp::sys_native_abs_path(pp($hstprvkeyf)); @@ -490,7 +490,7 @@ if ($sshdid =~ /OpenSSH-Windows/) { $sftpsrv_config = pathhelp::sys_native_abs_path($sftpsrv); $sshdconfig_abs = pathhelp::sys_native_abs_path($sshdconfig); } -elsif (pathhelp::os_is_win()) { +elsif(pathhelp::os_is_win()) { # Ensure to use MinGW/Cygwin paths $clipubkeyf_config = pathhelp::build_sys_abs_path(pp($clipubkeyf)); $hstprvkeyf_config = pathhelp::build_sys_abs_path(pp($hstprvkeyf)); @@ -599,10 +599,10 @@ push @cfgarr, '#'; # AllowUsers and DenyUsers options should use lowercase on Windows # and do not support quotes around values for some unknown reason. -if ($sshdid =~ /OpenSSH-Windows/) { +if($sshdid =~ /OpenSSH-Windows/) { my $username_lc = lc $username; push @cfgarr, "AllowUsers " . $username_lc =~ s/ /\?/gr; - if (exists $ENV{USERDOMAIN}) { + if(exists $ENV{USERDOMAIN}) { my $userdomain_lc = lc $ENV{USERDOMAIN}; $username_lc = "$userdomain_lc\\$username_lc"; $username_lc =~ s/ /\?/g; # replace space with ? @@ -617,7 +617,7 @@ if(!($sshdid =~ /OpenSSH/) || ($sshdvernum <= 590)) { push @cfgarr, "AuthorizedKeysFile2 $clipubkeyf_config"; } push @cfgarr, "HostKey $hstprvkeyf_config"; -if ($sshdid !~ /OpenSSH-Windows/) { +if($sshdid !~ /OpenSSH-Windows/) { push @cfgarr, "PidFile $pidfile_config"; push @cfgarr, '#'; } @@ -884,12 +884,12 @@ if((! -e pp($knownhosts)) || (! -s pp($knownhosts))) { # my $identity_config; my $knownhosts_config; -if ($sshdid =~ /OpenSSH-Windows/) { +if($sshdid =~ /OpenSSH-Windows/) { # Ensure to use native Windows paths with OpenSSH for Windows $identity_config = pathhelp::sys_native_abs_path(pp($identity)); $knownhosts_config = pathhelp::sys_native_abs_path(pp($knownhosts)); } -elsif (pathhelp::os_is_win()) { +elsif(pathhelp::os_is_win()) { # Ensure to use MinGW/Cygwin paths $identity_config = pathhelp::build_sys_abs_path(pp($identity)); $knownhosts_config = pathhelp::build_sys_abs_path(pp($knownhosts)); @@ -994,7 +994,7 @@ push @cfgarr, 'Protocol 2'; push @cfgarr, '#'; # BindAddress option is not supported by OpenSSH for Windows -if (!($sshdid =~ /OpenSSH-Windows/)) { +if(!($sshdid =~ /OpenSSH-Windows/)) { push @cfgarr, "BindAddress $listenaddr"; } @@ -1021,7 +1021,7 @@ push @cfgarr, 'PreferredAuthentications publickey'; push @cfgarr, 'PubkeyAuthentication yes'; # RSA authentication options are deprecated by newer OpenSSH -if (!($sshid =~ /OpenSSH/) || ($sshvernum <= 730)) { +if(!($sshid =~ /OpenSSH/) || ($sshvernum <= 730)) { push @cfgarr, 'RhostsRSAAuthentication no'; push @cfgarr, 'RSAAuthentication no'; } @@ -1195,7 +1195,7 @@ logmsg "RUN: $cmd\n" if($verbose); #*************************************************************************** # Start the ssh server daemon on Windows without forking it # -if ($sshdid =~ /OpenSSH-Windows/) { +if($sshdid =~ /OpenSSH-Windows/) { # Fake pidfile for ssh server on Windows. if(open(my $out, ">", "$pidfile")) { print $out $$ . "\n"; diff --git a/tests/test1119.pl b/tests/test1119.pl index f48d602919..ed8247ce0c 100755 --- a/tests/test1119.pl +++ b/tests/test1119.pl @@ -43,7 +43,7 @@ my $rc = eval { }; # Set default values if configure has not generated a configurehelp.pm file. # This is the case with cmake. -if (!$rc) { +if(!$rc) { $Cpreprocessor = 'cpp'; } @@ -67,8 +67,8 @@ my %rem; sub scanenum { my ($file) = @_; open my $h_in, "-|", "$Cpreprocessor $i$file" || die "Cannot preprocess $file"; - while ( <$h_in> ) { - if ( /enum\s+(\S+\s+)?{/ .. /}/ ) { + while( <$h_in> ) { + if( /enum\s+(\S+\s+)?{/ .. /}/ ) { s/^\s+//; next unless /^CURL/; chomp; @@ -83,7 +83,7 @@ sub scanheader { my ($f)=@_; open my $h, "<", "$f"; while(<$h>) { - if (/^#define ((LIB|)CURL[A-Za-z0-9_]*)/) { + if(/^#define ((LIB|)CURL[A-Za-z0-9_]*)/) { push @syms, $1; } } diff --git a/tests/test1135.pl b/tests/test1135.pl index 103594e796..0005c69309 100755 --- a/tests/test1135.pl +++ b/tests/test1135.pl @@ -75,20 +75,20 @@ foreach my $f (@incs) { while() { s/CURL_DEPRECATED\(.*"\)//; s/ */ /g; - if (/^(^CURL_EXTERN .*?)\(/) { + if(/^(^CURL_EXTERN .*?)\(/) { my $decl = $1; $decl =~ s/\r$//; $decl =~ /([a-z_]+)$/; push(@out, "$1"); } - elsif (/^(^CURL_EXTERN .*)/) { + elsif(/^(^CURL_EXTERN .*)/) { # handle two-line declarations my $decl = $1; $decl =~ s/\r$//; $first = $decl; } elsif($first) { - if (/^ *(.*)\(/) { + if(/^ *(.*)\(/) { my $decl = $1; $decl =~ s/\r$//; $first .= $decl; diff --git a/tests/test1167.pl b/tests/test1167.pl index 875f8c8b48..f38d211cce 100755 --- a/tests/test1167.pl +++ b/tests/test1167.pl @@ -43,7 +43,7 @@ my $rc = eval { }; # Set default values if configure has not generated a configurehelp.pm file. # This is the case with cmake. -if (!$rc) { +if(!$rc) { $Cpreprocessor = 'cpp'; } @@ -74,7 +74,7 @@ sub scanenums { open H_IN, "-|", "$Cpreprocessor -DCURL_DISABLE_DEPRECATION $i$file" || die "Cannot preprocess $file"; - while ( ) { + while() { my ($line, $linenum) = ($_, $.); if( /^#(line|) (\d+) \"(.*)\"/) { # if the included file isn't in our incdir, then we skip this section @@ -91,10 +91,10 @@ sub scanenums { if($skipit) { next; } - if (/^#/) { + if(/^#/) { next; } - if ( /enum\s+(\S+\s+)?{/ .. /}/ ) { + if( /enum\s+(\S+\s+)?{/ .. /}/ ) { s/^\s+//; chomp; s/[,\s].*//; @@ -122,7 +122,7 @@ sub scanheader { open H, "<$f"; while() { my ($line, $linenum) = ($_, $.); - if (/^ *# *define +([^ \n]*)/) { + if(/^ *# *define +([^ \n]*)/) { if($verbose) { print "Source: $f\n"; print "Symbol: $1\n"; diff --git a/tests/test1488.pl b/tests/test1488.pl index 4957d305c1..7038f58696 100755 --- a/tests/test1488.pl +++ b/tests/test1488.pl @@ -43,7 +43,7 @@ my $rc = eval { }; # Set default values if configure has not generated a configurehelp.pm file. # This is the case with cmake. -if (!$rc) { +if(!$rc) { $Cpreprocessor = 'cpp'; } diff --git a/tests/testcurl.pl b/tests/testcurl.pl index 6a96435a9f..514bf1cab4 100755 --- a/tests/testcurl.pl +++ b/tests/testcurl.pl @@ -261,9 +261,9 @@ if($name && $email && $desc) { $infixed=4; $fixed=4; } -elsif (open(my $f, "<", "$setupfile")) { - while (<$f>) { - if (/(\w+)=(.*)/) { +elsif(open(my $f, "<", "$setupfile")) { + while(<$f>) { + if(/(\w+)=(.*)/) { eval "\$$1=$2;"; } } @@ -296,7 +296,7 @@ if(!$desc) { } if(!$confopts) { - if ($infixed < 4) { + if($infixed < 4) { print "please enter your additional arguments to configure\n"; print "examples: --with-openssl --enable-debug --enable-ipv6\n"; $confopts = <>; @@ -372,7 +372,7 @@ if(-d $CURLDIR) { unlink "$CURLDIR/src/tool_hugehelp.c"; # find out if curl source dir has an in-tree c-ares repo $have_embedded_ares = 1 if (-f "$CURLDIR/ares/GIT-INFO"); - } elsif (!$git && -f "$CURLDIR/tests/testcurl.pl") { + } elsif(!$git && -f "$CURLDIR/tests/testcurl.pl") { logit "$CURLDIR is verified to be a fine daily source dir"; # find out if curl source dir has an in-tree c-ares extracted tarball $have_embedded_ares = 1 if (-f "$CURLDIR/ares/ares_build.h"); @@ -499,7 +499,7 @@ if($git) { # Set timestamp to the one in curlver.h if this isn't a git test build. if((-f "include/curl/curlver.h") && (open(my $f, "<", "include/curl/curlver.h"))) { - while (<$f>) { + while(<$f>) { chomp; if($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) { my $stampstring = $1; @@ -516,8 +516,8 @@ if((-f "include/curl/curlver.h") && # Show timestamp we are using for this test build. logit "timestamp = $timestamp"; -if ($configurebuild) { - if (-f "configure") { +if($configurebuild) { + if(-f "configure") { logit "configure created (at least it exists)"; } else { mydie "no configure created/found"; @@ -620,7 +620,7 @@ if(($have_embedded_ares) && $confheader =~ s/curl/ares/; logit_spaced "display ares/$confheader"; if(open($f, "<", "ares/$confheader")) { - while (<$f>) { + while(<$f>) { print if /^ *#/; } close($f); @@ -657,27 +657,27 @@ if(($have_embedded_ares) && my $mkcmd = "$make -i" . ($targetos && !$configurebuild ? " $targetos" : ""); logit "$mkcmd"; open(my $f, "-|", "$mkcmd 2>&1") or die; -while (<$f>) { +while(<$f>) { s/$pwd//g; print; } close($f); -if (-f "lib/libcurl$libext") { +if(-f "lib/libcurl$libext") { logit "libcurl was created fine (libcurl$libext)"; } else { mydie "libcurl was not created (libcurl$libext)"; } -if (-f "src/curl$binext") { +if(-f "src/curl$binext") { logit "curl was created fine (curl$binext)"; } else { mydie "curl was not created (curl$binext)"; } -if (!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) { +if(!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) { logit "display curl${binext} --version output"; my $cmd = ($extvercmd ne '' ? $extvercmd.' ' : '')."./src/curl${binext} --version|"; open($f, "<", $cmd); @@ -700,7 +700,7 @@ if($configurebuild && !$crosscompile) { logit_spaced "build examples"; open($f, "-|", "$make -i 2>&1") or die; open(my $log, ">", "$buildlog") or die; - while (<$f>) { + while(<$f>) { s/$pwd//g; print; print $log $_; @@ -747,7 +747,7 @@ else { logit_spaced "build examples"; open($f, "-|", "$make -i 2>&1") or die; open(my $log, ">", "$buildlog") or die; - while (<$f>) { + while(<$f>) { s/$pwd//g; print; print $log $_; @@ -762,7 +762,7 @@ else { logit_spaced "build test harness"; open(my $f, "-|", "$make -i 2>&1") or die; open(my $log, ">", "$buildlog") or die; - while (<$f>) { + while(<$f>) { s/$pwd//g; print; print $log $_; diff --git a/tests/testutil.pm b/tests/testutil.pm index 47054627fc..d1cf0c6b34 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -247,7 +247,7 @@ sub subsha256base64file { my ($thing) = @_; # SHA-256 base64 - while ($$thing =~ s/%sha256b64file\[(.*?)\]sha256b64file%/%%SHA256B64FILE%%/i) { + while($$thing =~ s/%sha256b64file\[(.*?)\]sha256b64file%/%%SHA256B64FILE%%/i) { my $file_path = $1; $file_path =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; my $hash_b64 = get_sha256_base64($file_path); @@ -268,7 +268,7 @@ sub substrippemfile { my ($thing) = @_; # File content substitution - while ($$thing =~ s/%strippemfile\[(.*?)\]strippemfile%/%%FILE%%/i) { + while($$thing =~ s/%strippemfile\[(.*?)\]strippemfile%/%%FILE%%/i) { my $file_path = $1; $file_path =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; my $file_content = get_file_content($file_path);