* verror.c (verror_at_line): Work around glibc bug 2997, so that
authorEric Blake <ebb9@byu.net>
Tue, 8 Aug 2006 22:00:44 +0000 (22:00 +0000)
committerEric Blake <ebb9@byu.net>
Tue, 8 Aug 2006 22:00:44 +0000 (22:00 +0000)
verror_at_line output complies with GNU Coding Standards even when
file is NULL.

lib/ChangeLog
lib/verror.c

index 38f2578b0ccc41deb905dc550f8066630569d503..c356e990a299780d4d9ace41a4ace59f630f642a 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-08  Eric Blake  <ebb9@byu.net>
+
+       * verror.c (verror_at_line): Work around glibc bug 2997, so that
+       verror_at_line output complies with GNU Coding Standards even when
+       file is NULL.
+
 2006-08-08  Eric Blake  <ebb9@byu.net>
 
        * verror.h, verror.c: New files.
index f9c869ec8489c4ed7933bcf18ffe0b5cbbf3ad6e..3011ab5f30c8ca1e051b8b4accafd63589acb405 100644 (file)
@@ -59,7 +59,15 @@ verror_at_line (int status, int errnum, const char *file,
 {
   char *message = xvasprintf (format, args);
   if (message)
-    error_at_line (status, errnum, file, line_number, "%s", message);
+    {
+      /* Until http://sourceware.org/bugzilla/show_bug.cgi?id=2997 is fixed,
+        glibc violates GNU Coding Standards when the file argument to
+        error_at_line is NULL.  */
+      if (file)
+        error_at_line (status, errnum, file, line_number, "%s", message);
+      else
+        error (status, errnum, "%s", message);
+    }
   else
     {
       /* EOVERFLOW, EINVAL, and EILSEQ from xvasprintf are signs of