From f048f049e7dd531e207c630088d050c376b39feb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 16 Aug 2006 17:24:35 +0000 Subject: (memcoll): Set errno = 0 in the shortcut case, too. --- lib/ChangeLog | 6 ++++++ lib/memcoll.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 + + * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too. + Problem and fix reported by Pádraig Brady in + . + 2006-08-16 Jim Meyering * 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]; -- cgit v1.2.3-70-g09d2