summaryrefslogtreecommitdiff
path: root/innobase/ut/ut0byte.c
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2004-04-26 15:53:31 +0300
committerunknown <monty@mishka.local>2004-04-26 15:53:31 +0300
commit196b976ec127201ff873d8ca95b51b0a78fcd988 (patch)
tree25e3315af05fa92d20d2ad1d812882957c400337 /innobase/ut/ut0byte.c
parentfc67a82899a640859306f5d59213d0b7e837a63a (diff)
parentaab529aba5f0cdae53f91ee2ecb4463ef892f02f (diff)
downloadmariadb-git-196b976ec127201ff873d8ca95b51b0a78fcd988.tar.gz
Merge with 4.0
innobase/dict/dict0boot.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/dict/dict0mem.c: Auto merged innobase/fut/fut0lst.c: Auto merged innobase/include/buf0lru.h: Auto merged innobase/include/dict0mem.h: Auto merged innobase/include/fsp0fsp.h: Auto merged innobase/include/ha0ha.h: Auto merged innobase/include/ibuf0ibuf.h: Auto merged innobase/include/lock0lock.h: Auto merged innobase/include/log0log.h: Auto merged innobase/include/mem0pool.h: Auto merged innobase/include/mtr0mtr.h: Auto merged innobase/include/os0file.h: Auto merged innobase/include/rem0rec.h: Auto merged innobase/include/rem0rec.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/sync0sync.h: Auto merged innobase/include/trx0sys.h: Auto merged innobase/include/ut0byte.h: Auto merged innobase/include/ut0ut.h: Auto merged innobase/mem/mem0pool.c: Auto merged innobase/mtr/mtr0mtr.c: Auto merged innobase/os/os0proc.c: Auto merged innobase/pars/lexyy.c: Auto merged innobase/pars/pars0opt.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0purge.c: Auto merged innobase/row/row0uins.c: Auto merged innobase/row/row0umod.c: Auto merged innobase/row/row0undo.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/trx/trx0purge.c: Auto merged innobase/trx/trx0roll.c: Auto merged innobase/trx/trx0sys.c: Auto merged innobase/trx/trx0undo.c: Auto merged innobase/ut/ut0byte.c: Auto merged pstack/bucomm.h: Auto merged pstack/budbg.h: Auto merged sql/item_sum.h: Auto merged sql/slave.cc: Auto merged sql/sql_db.cc: Auto merged support-files/mysql.spec.sh: Auto merged tests/insert_test.c: Auto merged mysql-test/t/func_group.test: Merge with 4.0 Put 4.1 tests lasts sql/ha_innodb.cc: Merge with 4.0 Added checking of results from my_malloc() BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'innobase/ut/ut0byte.c')
-rw-r--r--innobase/ut/ut0byte.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/innobase/ut/ut0byte.c b/innobase/ut/ut0byte.c
index 74198419560..8764103dc36 100644
--- a/innobase/ut/ut0byte.c
+++ b/innobase/ut/ut0byte.c
@@ -36,9 +36,9 @@ Copies a string to a memory location, setting characters to lower case. */
void
ut_cpy_in_lower_case(
/*=================*/
- char* dest, /* in: destination */
- char* source,/* in: source */
- ulint len) /* in: string length */
+ char* dest, /* in: destination */
+ const char* source, /* in: source */
+ ulint len) /* in: string length */
{
ulint i;
@@ -53,23 +53,27 @@ Compares two strings when converted to lower case. */
int
ut_cmp_in_lower_case(
/*=================*/
- /* out: -1, 0, 1 if str1 < str2, str1 == str2,
- str1 > str2, respectively */
- char* str1, /* in: string1 */
- char* str2, /* in: string2 */
- ulint len) /* in: length of both strings */
+ /* out: -1, 0, 1 if str1 < str2, str1 == str2,
+ str1 > str2, respectively */
+ const char* str1, /* in: string1 */
+ const char* str2) /* in: string2 */
{
- ulint i;
-
- for (i = 0; i < len; i++) {
- if (tolower(str1[i]) < tolower(str2[i])) {
- return(-1);
- }
-
- if (tolower(str1[i]) > tolower(str2[i])) {
- return(1);
- }
- }
+ for (;;) {
+ int c1, c2;
+ if (!*str1) {
+ return(*str2 ? -1 : 0);
+ } else if (!*str2) {
+ return 1;
+ }
+ c1 = tolower(*str1++);
+ c2 = tolower(*str2++);
+ if (c1 < c2) {
+ return(-1);
+ }
+ if (c1 > c2) {
+ return(1);
+ }
+ }
- return(0);
+ return(0);
}