git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a1c3dd
)
r2437: implemented a suggestion from abartlet that if we cannot convert
author
Andrew Tridgell
<tridge@samba.org>
Mon, 20 Sep 2004 07:31:54 +0000
(07:31 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 17:58:53 +0000
(12:58 -0500)
strings to UTF16 in StrCaseCmp() that we fall back to a simpler
comparison.
(This used to be commit
2fa6ab9fe30aeacd7b1421fd83c409acf31c98aa
)
source4/lib/util_str.c
patch
|
blob
|
history
diff --git
a/source4/lib/util_str.c
b/source4/lib/util_str.c
index 961bdb8084f057ab5613d6368e4b2d02888b07a4..3fe6fd1cc02af720787fffba0422d18228de1428 100644
(file)
--- a/
source4/lib/util_str.c
+++ b/
source4/lib/util_str.c
@@
-123,8
+123,11
@@
static int StrCaseCmp_slow(const char *s1, const char *s2)
smb_ucs2_t *u1, *u2;
int ret;
- convert_string_allocate(CH_UNIX, CH_UTF16, s1, strlen(s1)+1, &u1);
- convert_string_allocate(CH_UNIX, CH_UTF16, s2, strlen(s2)+1, &u2);
+ if (convert_string_allocate(CH_UNIX, CH_UTF16, s1, strlen(s1)+1, &u1) == -1 ||
+ convert_string_allocate(CH_UNIX, CH_UTF16, s2, strlen(s2)+1, &u2) == -1) {
+ /* fallback to a simple comparison */
+ return strcasecmp(s1, s2);
+ }
ret = strcasecmp_w(u1, u2);