From: Walter Harms <wharms@bfs.de>
To: Andrew Micallef <andrew.micallef@live.com.au>,
"linux-man@vger.kernel.org" <linux-man@vger.kernel.org>
Subject: AW: Suggestion for edit
Date: Tue, 7 Apr 2020 10:52:07 +0000 [thread overview]
Message-ID: <cbe041d18e2340d9a82a575cf32db44c@bfs.de> (raw)
In-Reply-To: <MN2PR04MB615789FF54F31389096E584BB9C30@MN2PR04MB6157.namprd04.prod.outlook.com>
the posix page is more direct about that.
"The sign of a non-zero return value shall be determined by the sign of the difference between the values of the first pair of bytes (both interpreted as type unsigned char) that differ in the strings being compared."
re,
wh
________________________________________
Von: Andrew Micallef <andrew.micallef@live.com.au>
Gesendet: Dienstag, 7. April 2020 11:45:03
An: Walter Harms; linux-man@vger.kernel.org
Betreff: Re: Suggestion for edit
Hi Walter
Actually that new phrasing on the last sentence is much clearer. I was scratching my head over what it meant for a string to be less than (or greater than) another string.
Cheers
Andrew
From: Walter Harms <wharms@bfs.de>
Sent: Tuesday, 7 April 2020 7:17 PM
To: Andrew Micallef <andrew.micallef@live.com.au>; linux-man@vger.kernel.org <linux-man@vger.kernel.org>
Subject: AW: Suggestion for edit
hi Andrew, i have to admit that i dropped over the last sentence. And it should be *very* clear what the return means,
ehre my idea:
If both strings are equal the function returns 0.
Otherwises it returns the differences between the last compared characters.
The last feature is important for sorting. I never found a good wording for that.
re,
wh
________________________________________
Von: linux-man-owner@vger.kernel.org <linux-man-owner@vger.kernel.org> im Auftrag von Andrew Micallef <andrew.micallef@live.com.au>
Gesendet: Dienstag, 7. April 2020 09:07:50
An: linux-man@vger.kernel.org
Betreff: Fw: Suggestion for edit
Hi,
I'd like to suggest an edit to the description of `strcmp` in the standard C library man page.
I found this description to be kind of confusing, and think the language could be a bit more
straight forward.
At present the description reads as follows:
The strcmp() function compares the two strings s1 and s2. The locale
is not taken into account (for a locale-aware comparison, see
strcoll(3)). It returns an integer less than, equal to, or greater
than zero if s1 is found, respectively, to be less than, to match, or
be greater than s2.
I am suggesting the following edits:
The strcmp() function compares the two strings s1 and s2. The locale
is not taken into account (for a locale-aware comparison, see
strcoll(3)). It returns an integer, which is 0 if the strings
match. Otherwise, a negative integer indicates s1 is less than s2,
while a positive integer indicates s1 is greater than s2.
Regards
Andrew
next prev parent reply other threads:[~2020-04-07 10:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <MN2PR04MB6157E89BBF15AD9D70DDEA48B9C30@MN2PR04MB6157.namprd04.prod.outlook.com>
2020-04-07 7:07 ` Fw: Suggestion for edit Andrew Micallef
2020-04-07 8:25 ` Ponnuvel Palaniyappan
2020-04-07 9:17 ` AW: " Walter Harms
2020-04-07 9:45 ` Andrew Micallef
2020-04-07 10:52 ` Walter Harms [this message]
2020-04-09 9:50 ` Michael Kerrisk (man-pages)
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=cbe041d18e2340d9a82a575cf32db44c@bfs.de \
--to=wharms@bfs.de \
--cc=andrew.micallef@live.com.au \
--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