Skip to contentSkip to conversation

mbsrtowcs, mbsnrtowcs: wfix

PATCH In review David Prévot 2 participants 4 messages Oct 15, 2011 – Oct 16, 2011 2 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mbsrtowcs, mbsnrtowcs: wfix

---
 man3/mbsnrtowcs.3 |    2 +-
 man3/mbsrtowcs.3  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
man3/mbsnrtowcs.3 +1 -1
index bbd1d71..9a7a5bf 100644
@@ -80,7 +80,7 @@ next multibyte sequence to be converted, and the number of wide characters
 written to \fIdest\fP is returned.
 .IP 3.
 The multibyte string has been completely converted, including the
-terminating null wide character (\(aq\\0\(aq)
+terminating wide character (\(aq\\0\(aq)
 (which has the side effect of bringing back \fI*ps\fP to the
 initial state).
 In this case \fI*src\fP is set to NULL, and the number of wide
man3/mbsrtowcs.3 +1 -1
index fcf47ca..fc8c802 100644
@@ -51,7 +51,7 @@ multibyte sequence to be converted,
 and the number of wide characters written to \fIdest\fP is returned.
 .IP 3.
 The multibyte string has been completely converted, including the
-terminating null wide character (\(aq\\0\(aq), which has the side
+terminating null character (\(aq\\0\(aq), which has the side
 effect of bringing back \fI*ps\fP to the
 initial state.
 In this case \fI*src\fP is set to NULL, and the number of wide
Signature · 6 lines
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1318641386-24095-1-git-send-email-taffit-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Michael,

The title of the previous patch should have been:

mbsrtowcs.3, mbsnrtowcs.3: wfix

sorry about that.

Cheers

David

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJOmOCCAAoJELgqIXr9/gnyfK8P/1zbpzpHYcdAAYLrrRvvgAXx V5d2Vg6AWzZscwT2kUZ37rGZ41lNgs0n8mlSdcmJYvExBMEozAuZOSMxCSQLCeEp dDQZj7WYS1XU+JnTV88h9ZhAtQ1rooH7atwYCaFu3tXR0AxUV3PtBuQWdI+1SACD c6PCyoiInH7IVm3dLxk6q1t2Jd0Jx//+UxzvQjb9OiT/KPt0Y2Tv2+QPirSVKUfW RPsL+U7OZwGcgPg2Dqu4J/NnP+s+7Ytka1gG8DCojFRbuDFLUbq1ezWnJCQ0m991 69epUembQ91A31O1maInfRKV6DFiEt5b6uEBZBjQgSmLDxFMgXTPUnOJGVCBSrZS tuKkopEbITfK4pTYVArxcTLbwNZt8oVXjYR9JnREPT8grccQSZZzdXMhrLjD9o4s TiFL0IghhO2tXj3R/0Y48k4/387uvevrUZl2nfEbJx8kVUeC8eM8ru2M0fEjIlqZ U6uJVT24TkUzPt8SWnjyi69+f5eqjtYiHUL2UQNWs/AltkFz1X6HS8yA8YVScB7k kZBe7ANatVnMpVD9NrG2iAd6EphYIjhq2jOd9Xrv6vDtSxsc5uGeEAkjAp4Q44Wu PZYKyQ9mOpZ2X9ZAMZ9XD4QJxd6e+acJondozt6DGL85UJkB7uoWbJQcmjxEiLYD D2CS18xv9jC5gxwiJ16R
=yjpG
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to a message not in the archive

Hi David,

Quoted 30 lines · David Prévot

---
 man3/mbsnrtowcs.3 |    2 +-
 man3/mbsrtowcs.3  |    2 +-

 2 files changed, 2 insertions(+), 2 deletions(-)
man3/mbsnrtowcs.3 +0 -0
index bbd1d71..9a7a5bf 100644
@@ -80,7 +80,7 @@ next multibyte sequence to be converted, and the number of wide characters

 written to \fIdest\fP is returned.
 .IP 3.
 The multibyte string has been completely converted, including the

man3/mbsnrtowcs.3 +1 -1
-terminating null wide character (\(aq\\0\(aq)
+terminating wide character (\(aq\\0\(aq)

 (which has the side effect of bringing back \fI*ps\fP to the initial state).
 In this case \fI*src\fP is set to NULL, and the number of wide

man3/mbsrtowcs.3 +0 -0
index fcf47ca..fc8c802 100644
@@ -51,7 +51,7 @@ multibyte sequence to be converted,

 and the number of wide characters written to \fIdest\fP is returned. .IP 3.
 The multibyte string has been completely converted, including the

man3/mbsrtowcs.3 +1 -1
-terminating null wide character (\(aq\\0\(aq), which has the side
+terminating null character (\(aq\\0\(aq), which has the side
Quoted 3 lines

 effect of bringing back \fI*ps\fP to the
 initial state.
 In this case \fI*src\fP is set to NULL, and the number of wide

This is one patch where I need some helpful explanation ;-).

Your changes above seem inconsistent. In the first case, you remove "null", and in the second, you remove "wide". I suspect the first case is a mistake, and you meant in both cases to change "null wide" to "null", right?

But, more generally, I think you are saying that there were some pieces of my older e9c23bc636426366d659809bc99cd84661e86464 that incorrectly changed "[terminating] null character" to "[terminating] null wide character", right?

If that's the case, I suspect that there more than just those two errors. I suspect that the first of my changes to mbstowcs.3 below was also incorrect. Can you confirm?

Cheers,

Michael

PS See also 3c81e148a228550b4ce3d20a9c68ce0eb91cef07, which I just pushed (to github). Do you agree with that change?

man3/mbstowcs.3 +0 -0
@@ -42,9 +42,9 @@ case the number of wide characters written to \fIdest\fP is re

turned, but the
shift state at this point is lost.
.IP 3.
The multibyte string has been completely converted, including the
-terminating \(aq\\0\(aq.
+terminating null wide character (\(aq\\0\(aq).
In this case the number of wide characters written to
-\fIdest\fP, excluding the terminating L\(aq\\0\(aq character, is returned. +\fIdest\fP, excluding the terminating null wide character, is returned.
.PP
The programmer must ensure that there is room for at least \fIn\fP wide characters at \fIdest\fP.

Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAKgNAkhee9nOi0p5B+XHRrd6hW6W4CxogO-dYLh3KhNA-7hDGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Michael,

Quoted 2 lines · Michael Kerrisk

and you meant in both cases to change "null wide" to "null", right?

Sure, sorry about that.

Quoted 4 lines

But, more generally, I think you are saying that there were some pieces of my older e9c23bc636426366d659809bc99cd84661e86464 that incorrectly changed "[terminating] null character" to "[terminating] null wide character", right?

I didn't checked them all (yet), but your example bellow seems to concur with that assumption.

Review

Quoted 6 lines

I suspect that the first of my changes to mbstowcs.3 below was also incorrect. Can you confirm?

The multibyte string has been completely converted, including the

(quoted diff) +1 -1
-terminating \(aq\\0\(aq.
+terminating null wide character (\(aq\\0\(aq).

The change is indeed wrong, since \(aq\\0\(aq (i.e. '\0') is the terminating null byte (or character, but I think you tried to consistently use “byte” in your last changes), which is different from L\(aq\\0\(aq (i.e. L'\0'), the terminating null wide character.

Quoted 2 lines

PS See also 3c81e148a228550b4ce3d20a9c68ce0eb91cef07, which I just pushed (to github). Do you agree with that change?

Given the context (wide → multibyte), I agree that the “terminating null” in the destination string should be the terminating null byte ('\0'), but I didn't check the source code, or didn't test it either (just came across the previous inconsistencies while updating the French translations of these pages).

Regards

David

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJOmtj+AAoJELgqIXr9/gny9P4QAKWp9R22ZaSzHEPycEgcsqSw /H+BwFGpCgEX+Z0AWm2NSX4gc+5XPiX/gJQpOkFzMlRJ17no6KfLEaxSxV8cHKzJ 8NnYa6eK5KMbCg4QBicNi6BKiiLj35QY1h3h70HX/pmcbr0gmbEexuqj/dwnwBPB 1WPwpZ3fcNzCYRDZzEkzXOfXhoFlGC+XfOOC5Uwn56TEXx03gGFeJsCTRW9V7lzX 0VL9n8E3FLGJSW8Am/EQ8hGzwGbiuzXaJntkwNj3b5kaof/wc7iwo82xwgX3Nc+K l6+d+NuK1hbY8Cvu81B0jOtv6MTdPR14x5lo0YtM/onLHKs5a4Rt149/sH0zlGQO uAEh+FEv59D0qvJkkeZsXpWjehqs1YJDv82bRcfz5H4ZIVUzJTnKhBQnI4MjX2m9 gTNg1eiC7+Jt0qge5L7PRwVGuxiCI1MG5tGeogiGdv/GCEIqJ6OFwQjeFjk3Iz1m pTvm0AcLyNz/w70rGQ8vfIsPscuIy1tY0t00vioIDaHv6kAdCuYVytU33OHK5jWQ xdXMwWGdwWH1nYjhYU5gwoFsQUQpgmHugwTgXsEIgvgvopGp9OhHLd+kcDUw7Uyn 3HVBdDG522B4TwstBTdpyMMhlOgRAGvBHsfYVrvtIecHm/JgxLwoPr2KLyC1n9MD /iuRZR2+K6YdTAfen3vi
=B/Qv
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html