diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-09-30 13:30:52 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-09-30 13:30:52 +0000 |
commit | b7ca6ec034c8b707e462e4a4457a65ce9bea0f79 (patch) | |
tree | db1912872e08fc3feaeaa4ee37147599495c5e8f /source3/lib/charcnv.c | |
parent | 9a22ac94a4d1be0377562644e3704a2134b9d645 (diff) | |
download | samba-b7ca6ec034c8b707e462e4a4457a65ce9bea0f79.tar.gz samba-b7ca6ec034c8b707e462e4a4457a65ce9bea0f79.tar.xz samba-b7ca6ec034c8b707e462e4a4457a65ce9bea0f79.zip |
make strupper() and strlower() not modify the string if it doesn't
need modifying
that makes constant strings OK
(This used to be commit 57196635d9b7edfcbfe1708dd22308ab30c02240)
Diffstat (limited to 'source3/lib/charcnv.c')
-rw-r--r-- | source3/lib/charcnv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index adcd8b2aa9..55d56acf59 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -140,7 +140,7 @@ int unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen) smb_ucs2_t *buffer=(smb_ucs2_t*)cvtbuf; size=convert_string(CH_UNIX, CH_UCS2, src, srclen, buffer, sizeof(cvtbuf)); len=size/2; - strupper_w(buffer); + if (!strupper_w(buffer) && (dest == src)) return srclen; return convert_string(CH_UCS2, CH_UNIX, buffer, size, dest, destlen); } @@ -150,7 +150,7 @@ int unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen) smb_ucs2_t *buffer=(smb_ucs2_t*)cvtbuf; size=convert_string(CH_UNIX, CH_UCS2, src, srclen, buffer, sizeof(cvtbuf)); len=size/2; - strlower_w(buffer); + if (!strlower_w(buffer) && (dest == src)) return srclen; return convert_string(CH_UCS2, CH_UNIX, buffer, size, dest, destlen); } |