From: Alejandro Colomar <alx@kernel.org>
To: Ben Song <bensongsyz@gmail.com>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH] man/man3/strcmp.3: replace equal/less/greater words
Date: Mon, 16 Mar 2026 01:25:09 +0100 [thread overview]
Message-ID: <abdLnYA73AoL6e3P@devuan> (raw)
In-Reply-To: <6385edaf0e1f056ac12df9b42c71fad48364b5a2.1773150610.git.bensongsyz@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2413 bytes --]
Hi Ben,
On 2026-03-10T21:52:48+0800, Ben Song wrote:
> There is no meaning for one string is `less than` or `greater than`
> another string, but the value of a character in two strings can be
> compared.
>
> Signed-off-by: Ben Song <bensongsyz@gmail.com>
> ---
> man/man3/strcmp.3 | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/man/man3/strcmp.3 b/man/man3/strcmp.3
> index 2784d51c8..bc238aec1 100644
> --- a/man/man3/strcmp.3
> +++ b/man/man3/strcmp.3
> @@ -23,11 +23,11 @@ .SH DESCRIPTION
> .BR strcmp ()
> The
> .BR strcmp ()
> -function compares the two strings
> +function compares the characters in two strings
> .I s1
> and
> -.IR s2 .
> -The locale is not taken into account (for a locale-aware comparison, see
> +.I s2
> +one by one until characters differ or until the end of one of the two strings is reached. The locale is not taken into account (for a locale-aware comparison, see
Please don't go past the 80-column right margin.
Also, use semantic newlines. See man-pages(7):
$ MANWIDTH=72 man man-pages | awk '/Use semantic newlines/,/^$/'
Use semantic newlines
In the source of a manual page, new sentences should be started on
new lines, long sentences should be split into lines at clause
breaks (commas, semicolons, colons, and so on), and long clauses
should be split at phrase boundaries. This convention, sometimes
known as "semantic newlines", makes it easier to see the effect of
patches, which often operate at the level of individual sentences,
clauses, or phrases.
> .BR strcoll (3)).
> The comparison is done using unsigned characters.
> .IP
> @@ -39,16 +39,16 @@ .SH DESCRIPTION
> .I s1
> and
> .I s2
> -are equal;
> +are identical;
> .IP \[bu]
> -a negative value if
> +a negative value if the value of first different character in
> .I s1
> -is less than
> +is less than that in
> .IR s2 ;
> .IP \[bu]
> -a positive value if
> +a positive value if the value of first different character in
> .I s1
> -is greater than
> +is greater than that in
> .IR s2 .
I think I prefer entirely removing this list. We should defer to
memcmp(3) for the description of the way the comparison is done.
Have a lovely night!
Alex
> .RE
> .IP
> --
> 2.53.0
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-03-16 0:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 13:52 [PATCH] man/man3/strcmp.3: replace equal/less/greater words Ben Song
2026-03-16 0:25 ` Alejandro Colomar [this message]
2026-03-19 3:09 ` Ben Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abdLnYA73AoL6e3P@devuan \
--to=alx@kernel.org \
--cc=bensongsyz@gmail.com \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox