Mail Archives: djgpp-workers/2003/02/27/10:05:06
I happened to see this in the Solaris man page for `errno':
The perror() function produces a message on the standard
error output....
The argument string s is printed, followed by a colon and a
blank, followed by the message and a NEWLINE character. If
s is a null pointer or points to a null string, the colon is
not printed.
So perhaps this patch to our perror.c is in order? (The manpage says
only that the colon is not printed; should the blank still be printed?)
--- perror.orig 1994-12-10 21:52:02.000000000 -0600
+++ perror.c 2003-02-27 08:58:59.960438000 -0600
@@ -6,5 +6,8 @@
void
perror(const char *s)
{
- fprintf(stderr, "%s: %s\n", s, strerror(errno));
+ if (s)
+ fprintf(stderr, "%s: %s\n", s, strerror(errno));
+ else
+ fprintf(stderr, "%s\n", s, strerror(errno));
}
- Raw text -