Hi Eric,

Seen on HP-UX 11.00:

test-strerror.c:52: assertion failed
sh[9]: 4155 Abort
FAIL: test-strerror

In config.status:
  GNULIB_STRERROR = 1
  HAVE_DECL_STRERROR = 1
  REPLACE_STRERROR = 1

In config.h:
/* Define to 1 if you have the declaration of `strerror', and to 0 if you
#define HAVE_DECL_STRERROR 1
/* Define this to 1 if strerror is broken. */
#define REPLACE_STRERROR 1

This patch fixes it for me. OK to commit?


2007-10-26  Bruno Haible  <[EMAIL PROTECTED]>

        * lib/strerror.c (rpl_strerror): Return "Unknown error ..." also if
        strerror returned the empty string. Needed on HP-UX 11.00.

--- lib/strerror.c.orig 2007-10-26 12:07:52.000000000 +0200
+++ lib/strerror.c      2007-10-26 12:04:57.000000000 +0200
@@ -35,7 +35,7 @@
 {
   char *result = strerror (n);
 
-  if (! result)
+  if (result == NULL || result[0] == '\0')
     {
       static char const fmt[] = "Unknown error (%d)";
       static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)];



Reply via email to