diff options
author | Bruno Haible <bruno@clisp.org> | 2009-03-08 03:18:26 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-03-08 03:18:26 +0100 |
commit | 4d0344cf0ca59b3d0e8e8396af65de1c50e06d9e (patch) | |
tree | 1765c8753f4d3c20cc2fafcac642a66bfb89f11d /lib/uninorm | |
parent | 45a1421304b3f60b91e2ab5fc191573f9d090a40 (diff) | |
download | gnulib-4d0344cf0ca59b3d0e8e8396af65de1c50e06d9e.tar.gz |
Adjust u*_normcmp, u*_normcoll API.
Diffstat (limited to 'lib/uninorm')
-rw-r--r-- | lib/uninorm/u-normcmp.h | 12 | ||||
-rw-r--r-- | lib/uninorm/u-normcoll.h | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/lib/uninorm/u-normcmp.h b/lib/uninorm/u-normcmp.h index 33d1e6252b..0305fbce31 100644 --- a/lib/uninorm/u-normcmp.h +++ b/lib/uninorm/u-normcmp.h @@ -31,17 +31,21 @@ FUNC (const UNIT *s1, size_t n1, const UNIT *s2, size_t n2, norms1_length = sizeof (buf1) / sizeof (UNIT); norms1 = U_NORMALIZE (nf, s1, n1, buf1, &norms1_length); if (norms1 == NULL) - return errno; + /* errno is set here. */ + return -1; /* Normalize S2. */ norms2_length = sizeof (buf2) / sizeof (UNIT); norms2 = U_NORMALIZE (nf, s2, n2, buf2, &norms2_length); if (norms2 == NULL) { - int saved_errno = errno; if (norms1 != buf1) - free (norms1); - return saved_errno; + { + int saved_errno = errno; + free (norms1); + errno = saved_errno; + } + return -1; } /* Compare the normalized strings. */ diff --git a/lib/uninorm/u-normcoll.h b/lib/uninorm/u-normcoll.h index 5af764eba1..a8bf29ca8e 100644 --- a/lib/uninorm/u-normcoll.h +++ b/lib/uninorm/u-normcoll.h @@ -31,17 +31,21 @@ FUNC (const UNIT *s1, size_t n1, const UNIT *s2, size_t n2, transformed1_length = sizeof (buf1); transformed1 = U_NORMXFRM (s1, n1, nf, buf1, &transformed1_length); if (transformed1 == NULL) - return errno; + /* errno is set here. */ + return -1; /* Normalize and transform S2. */ transformed2_length = sizeof (buf2); transformed2 = U_NORMXFRM (s2, n2, nf, buf2, &transformed2_length); if (transformed2 == NULL) { - int saved_errno = errno; if (transformed1 != buf1) - free (transformed1); - return saved_errno; + { + int saved_errno = errno; + free (transformed1); + errno = saved_errno; + } + return -1; } /* Compare the transformed strings. */ |