X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Funicase%2Fu-casecmp.h;h=1849d7d4ef17ebb964b41948b5af9c615d43a6e9;hb=30c3201628476927fee18e778dacafe1dadd7de2;hp=8ae23d703ff221929d0e9f21a0edb9152e0dfe33;hpb=80ae500d4237e39ce2c63aea80b2a34e5887ce90;p=gnulib.git diff --git a/lib/unicase/u-casecmp.h b/lib/unicase/u-casecmp.h index 8ae23d703..1849d7d4e 100644 --- a/lib/unicase/u-casecmp.h +++ b/lib/unicase/u-casecmp.h @@ -1,5 +1,5 @@ /* Case and normalization insensitive comparison of Unicode strings. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This program is free software: you can redistribute it and/or modify it @@ -45,24 +45,17 @@ FUNC (const SRC_UNIT *s1, size_t n1, const SRC_UNIT *s2, size_t n2, if (norms2 == NULL) { if (norms1 != buf1) - { - int saved_errno = errno; - free (norms1); - errno = saved_errno; - } + { + int saved_errno = errno; + free (norms1); + errno = saved_errno; + } return -1; } /* Compare the normalized strings. */ - cmp = U_CMP (norms1, norms2, MIN (norms1_length, norms2_length)); - if (cmp == 0) - { - if (norms1_length < norms2_length) - cmp = -1; - else if (norms1_length > norms2_length) - cmp = 1; - } - else if (cmp > 0) + cmp = U_CMP2 (norms1, norms1_length, norms2, norms2_length); + if (cmp > 0) cmp = 1; else if (cmp < 0) cmp = -1;