The Samba-Bugzilla – Attachment 575 Details for
Bug 1546
strupper_m and strlower_m set errno to 0 if a string has multibyte chars
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch to save errno
strlower_m-errno_save.patch (text/plain), 1.40 KB, created by
SATOH Fumiyasu
on 2004-07-22 03:16:13 UTC
(
hide
)
Description:
Proposed patch to save errno
Filename:
MIME Type:
Creator:
SATOH Fumiyasu
Created:
2004-07-22 03:16:13 UTC
Size:
1.40 KB
patch
obsolete
>Index: source/lib/util_str.c >=================================================================== >--- source/lib/util_str.c (revision 1561) >+++ source/lib/util_str.c (working copy) >@@ -1391,6 +1391,7 @@ char *strstr_m(const char *src, const ch > void strlower_m(char *s) > { > size_t len; >+ int errno_save; > > /* this is quite a common operation, so we want it to be > fast. We optimise for the ascii case, knowing that all our >@@ -1408,11 +1409,13 @@ void strlower_m(char *s) > /* I assume that lowercased string takes the same number of bytes > * as source string even in UTF-8 encoding. (VIV) */ > len = strlen(s) + 1; >+ errno_save = errno; > errno = 0; > unix_strlower(s,len,s,len); > /* Catch mb conversion errors that may not terminate. */ > if (errno) > s[len-1] = '\0'; >+ errno = errno_save; > } > > /** >@@ -1422,6 +1425,7 @@ void strlower_m(char *s) > void strupper_m(char *s) > { > size_t len; >+ int errno_save; > > /* this is quite a common operation, so we want it to be > fast. We optimise for the ascii case, knowing that all our >@@ -1439,11 +1443,13 @@ void strupper_m(char *s) > /* I assume that lowercased string takes the same number of bytes > * as source string even in multibyte encoding. (VIV) */ > len = strlen(s) + 1; >+ errno_save = errno; > errno = 0; > unix_strupper(s,len,s,len); > /* Catch mb conversion errors that may not terminate. */ > if (errno) > s[len-1] = '\0'; >+ errno = errno_save; > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1546
:
574
| 575