summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-08-16 17:24:35 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-08-16 17:24:35 +0000
commitf048f049e7dd531e207c630088d050c376b39feb (patch)
tree02a310487b12e7446e36487e9fb4a79e533035e1 /lib
parent061a90d68a7c62db9cdd0dac0ef23618e0fc187e (diff)
downloadcoreutils-f048f049e7dd531e207c630088d050c376b39feb.tar.xz
(memcoll): Set errno = 0 in the shortcut case, too.
Diffstat (limited to 'lib')
-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];