Skip to content

Commit

Permalink
man pages: remove trailing whitespaces
Browse files Browse the repository at this point in the history
Extended test 1173 (via the manpage-syntax.pl script) to detect and warn
for them.

Ref: #7602
Reported-by: a1346054 on github
Closes #7604
  • Loading branch information
bagder committed Aug 21, 2021
1 parent 77c7399 commit 4e53b94
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
1 change: 0 additions & 1 deletion docs/cmdline-opts/fail-with-body.d
Expand Up @@ -5,7 +5,6 @@ Category: http output
Added: 7.76.0
See-also: fail
---

Return an error on server errors where the HTTP response code is 400 or
greater). In normal cases when an HTTP server fails to deliver a document, it
returns an HTML document stating so (which often also describes why and
Expand Down
1 change: 0 additions & 1 deletion docs/cmdline-opts/http3.d
Expand Up @@ -8,7 +8,6 @@ Help: Use HTTP v3
See-also: http1.1 http2
Category: http
---

WARNING: this option is experimental. Do not use in production.

Tells curl to use HTTP version 3 directly to the host and port number used in
Expand Down
1 change: 0 additions & 1 deletion docs/cmdline-opts/insecure.d
Expand Up @@ -5,7 +5,6 @@ Protocols: TLS
See-also: proxy-insecure cacert
Category: tls
---

By default, every SSL connection curl makes is verified to be secure. This
option allows curl to proceed and operate even for server connections
otherwise considered insecure.
Expand Down
1 change: 0 additions & 1 deletion docs/cmdline-opts/quote.d
Expand Up @@ -5,7 +5,6 @@ Help: Send command(s) to server before transfer
Protocols: FTP SFTP
Category: ftp sftp
---

Send an arbitrary command to the remote FTP or SFTP server. Quote commands are
sent BEFORE the transfer takes place (just after the initial PWD command in an
FTP transfer, to be exact). To make commands take place after a successful
Expand Down
1 change: 0 additions & 1 deletion docs/cmdline-opts/ssl.d
Expand Up @@ -4,7 +4,6 @@ Protocols: FTP IMAP POP3 SMTP
Added: 7.20.0
Category: tls
---

Try to use SSL/TLS for the connection. Reverts to a non-secure connection if
the server doesn't support SSL/TLS. See also --ftp-ssl-control and --ssl-reqd
for different levels of encryption required.
Expand Down
1 change: 0 additions & 1 deletion docs/cmdline-opts/user-agent.d
Expand Up @@ -5,7 +5,6 @@ Help: Send User-Agent <name> to server
Protocols: HTTP
Category: important http
---

Specify the User-Agent string to send to the HTTP server. To encode blanks in
the string, surround the string with single quote marks. This header can also
be set with the --header or the --proxy-header options.
Expand Down
4 changes: 2 additions & 2 deletions docs/libcurl/libcurl-multi.3
Expand Up @@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -97,7 +97,7 @@ period for your select() calls.
\fIcurl_multi_perform(3)\fP stores the number of still running transfers in
one of its input arguments, and by reading that you can figure out when all
the transfers in the multi handles are done. 'done' does not mean
successful. One or more of the transfers may have failed.
successful. One or more of the transfers may have failed.

To get information about completed transfers, to figure out success or not and
similar, \fIcurl_multi_info_read(3)\fP should be called. It can return a
Expand Down
2 changes: 1 addition & 1 deletion docs/libcurl/opts/CURLOPT_PROXY_CAINFO_BLOB.3
Expand Up @@ -53,7 +53,7 @@ if(curl) {
curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
blob.data = strpem;
blob.len = strlen(strpem);
blob.flags = CURL_BLOB_COPY;
blob.flags = CURL_BLOB_COPY;
curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO_BLOB, &blob);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
Expand Down
6 changes: 6 additions & 0 deletions tests/data/test1173
Expand Up @@ -23,4 +23,10 @@ Basic man page syntax check
</command>
</client>

<verify>
<stderr>
ok
</stderr>
</verify>

</testcase>
8 changes: 7 additions & 1 deletion tests/manpage-syntax.pl
Expand Up @@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2019 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 2019 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -50,6 +50,10 @@ sub scanmanpage {
$errors++;
}
}
if($_ =~ /[ \t]+$/) {
print STDERR "$file:$line trailing whitespace\n";
$errors++;
}
$line++;
}
close(M);
Expand All @@ -60,4 +64,6 @@ sub scanmanpage {
scanmanpage($m);
}

print STDERR "ok\n" if(!$errors);

exit $errors;

3 comments on commit 4e53b94

@i-ky
Copy link
Contributor

@i-ky i-ky commented on 4e53b94 Aug 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/libcurl/mksymbolsmanpage.pl chokes on symbols containing lower case v (e.g. CURL_SSLVERSION_MAX_TLSv1_0), this seems to fix it:

diff --git a/docs/libcurl/mksymbolsmanpage.pl b/docs/libcurl/mksymbolsmanpage.pl
index 5a117d628..1e7a399ce 100755
--- a/docs/libcurl/mksymbolsmanpage.pl
+++ b/docs/libcurl/mksymbolsmanpage.pl
@@ -69,7 +69,7 @@ HEADER
     ;
 
 while(<STDIN>) {
-    if($_ =~ /^(CURL[A-Z0-9_.]*) *(.*)/) {
+    if($_ =~ /^(CURL[A-Zv0-9_.]*) *(.*)/) {
         my ($symbol, $rest)=($1,$2);
         my ($intro, $dep, $rem);
         if($rest =~ s/^([0-9.]*) *//) {

@i-ky
Copy link
Contributor

@i-ky i-ky commented on 4e53b94 Aug 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, the following looks a bit suspicious:

if($rem) {
print "Last used in $dep\n";
}

It checks $rem, but prints $dep. $dep is checked and printed a couple of lines above. Why print same thing twice? Shouldn't it print $rem instead?

@jay
Copy link
Member

@jay jay commented on 4e53b94 Aug 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/libcurl/mksymbolsmanpage.pl chokes on symbols containing lower case

By the way, the following looks a bit suspicious

Thanks, fixed in 342f927 and 9cb395d.

Please sign in to comment.