changeset 7131:02e62250d524

* misc/error.c: Add space between program name and message if file name is missing.
author Eric Blake <ebb9@byu.net>
date Mon, 14 Aug 2006 16:08:25 +0000
parents 6b91f203e6a7
children 0a847d3b0d21
files lib/ChangeLog lib/error.c
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,13 @@
+2006-08-14  Eric Blake  <ebb9@byu.net>
+
+	Import the following change from libc:
+
+	2006-08-12  Ulrich Drepper  <drepper@redhat.com>
+
+	Upstream bug 2997.
+	* misc/error.c: Add space between program name and message if file
+	name is missing.
+
 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
--- a/lib/error.c
+++ b/lib/error.c
@@ -310,14 +310,13 @@
 #endif
     }
 
-  if (file_name != NULL)
-    {
 #if _LIBC
-      __fxprintf (NULL, "%s:%d: ", file_name, line_number);
+  __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ",
+              file_name, line_number);
 #else
-      fprintf (stderr, "%s:%d: ", file_name, line_number);
+  fprintf (stderr, file_name != NULL ? "%s:%d: " : " ",
+           file_name, line_number);
 #endif
-    }
 
   va_start (args, message);
   error_tail (status, errnum, message, args);