projects
/
gnulib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6fd120f
)
Don't use strcoll if it is broken.
author
Bruno Haible
<bruno@clisp.org>
Tue, 31 Dec 2002 13:01:56 +0000
(13:01 +0000)
committer
Bruno Haible
<bruno@clisp.org>
Tue, 31 Dec 2002 13:01:56 +0000
(13:01 +0000)
lib/ChangeLog
patch
|
blob
|
history
lib/memcoll.c
patch
|
blob
|
history
diff --git
a/lib/ChangeLog
b/lib/ChangeLog
index
6055de6
..
1ff4fef
100644
(file)
--- a/
lib/ChangeLog
+++ b/
lib/ChangeLog
@@
-1,3
+1,8
@@
+2002-12-23 Bruno Haible <bruno@clisp.org>
+
+ * memcoll.c (STRCOLL): New macro.
+ (memcoll): Use it.
+
2002-12-22 Bruno Haible <bruno@clisp.org>
* getstr.h (getstr): Define, to avoid clash with libcurses.
2002-12-22 Bruno Haible <bruno@clisp.org>
* getstr.h (getstr): Define, to avoid clash with libcurses.
diff --git
a/lib/memcoll.c
b/lib/memcoll.c
index
a2decfe
..
e1b884e
100644
(file)
--- a/
lib/memcoll.c
+++ b/
lib/memcoll.c
@@
-32,6
+32,13
@@
extern int errno;
# include <string.h>
#endif
# include <string.h>
#endif
+/* Use strcoll() only if it really works. */
+#if HAVE_STRCOLL
+# define STRCOLL strcoll
+#else
+# define STRCOLL strcmp
+#endif
+
/* Compare S1 (with length S1LEN) and S2 (with length S2LEN) according
to the LC_COLLATE locale. S1 and S2 do not overlap, and are not
adjacent. Temporarily modify the bytes after S1 and S2, but
/* Compare S1 (with length S1LEN) and S2 (with length S2LEN) according
to the LC_COLLATE locale. S1 and S2 do not overlap, and are not
adjacent. Temporarily modify the bytes after S1 and S2, but
@@
-47,7
+54,7
@@
memcoll (char *s1, size_t s1len, char *s2, size_t s2len)
s1[s1len++] = '\0';
s2[s2len++] = '\0';
s1[s1len++] = '\0';
s2[s2len++] = '\0';
- while (! (errno = 0, (diff =
strcoll
(s1, s2)) || errno))
+ while (! (errno = 0, (diff =
STRCOLL
(s1, s2)) || errno))
{
/* strcoll found no difference, but perhaps it was fooled by NUL
characters in the data. Work around this problem by advancing
{
/* strcoll found no difference, but perhaps it was fooled by NUL
characters in the data. Work around this problem by advancing