summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ChangeLog6
-rw-r--r--lib/memcoll.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index c65dde33e..00c19a3c7 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
+ Problem and fix reported by Pádraig Brady in
+ <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
+
2006-08-16 Jim Meyering <jim@meyering.net>
* fts.c (fts_children): Remove obsolete "// FIXME ..." comment.
diff --git a/lib/memcoll.c b/lib/memcoll.c
index 7f61a6b58..457d1104a 100644
--- a/lib/memcoll.c
+++ b/lib/memcoll.c
@@ -43,7 +43,10 @@ memcoll (char *s1, size_t s1len, char *s2, size_t s2len)
the buffers using strcoll on each substring. */
if (s1len == s2len && memcmp (s1, s2, s1len) == 0)
- diff = 0;
+ {
+ errno = 0;
+ diff = 0;
+ }
else
{
char n1 = s1[s1len];