aboutsummaryrefslogtreecommitdiff
path: root/stdlib/fmtmsg.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-27 23:37:52 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-27 23:37:52 +0000
commit9f6c1fc4947e0b6d007cff159166bc0373386c61 (patch)
treeacf2ed53901c12bf2fa3137cbd4515c4da9d3932 /stdlib/fmtmsg.c
parent6d5503b16a70cdddc904b7614b9927ee55720a27 (diff)
downloadglibc-9f6c1fc4947e0b6d007cff159166bc0373386c61.tar
glibc-9f6c1fc4947e0b6d007cff159166bc0373386c61.tar.gz
glibc-9f6c1fc4947e0b6d007cff159166bc0373386c61.tar.bz2
glibc-9f6c1fc4947e0b6d007cff159166bc0373386c61.zip
Update.
* stdlib/fmtmsg.c (fmtmsg): Change output format slightly to make it look better and bring it closer to SysV behavior. * stdlib/Makefile (distribute): Add tst-fmtmsg.sh. (test-srcs): Add tst-fmtmsg. (tests): Add $(objpfx)tst-fmtmsg.out. Add rule to generate it. * stdlib/tst-fmtmsg.sh: New file. * stdlib/tst-fmtmsg.c: New file.
Diffstat (limited to 'stdlib/fmtmsg.c')
-rw-r--r--stdlib/fmtmsg.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
index 126132d859..1c9e4298cd 100644
--- a/stdlib/fmtmsg.c
+++ b/stdlib/fmtmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -145,15 +145,15 @@ fmtmsg (long int classification, const char *label, int severity,
if (fprintf (stderr, "%s%s%s%s%s%s%s%s%s%s\n",
do_label ? label : "",
- do_label && (do_severity | do_text) ? ": " : "",
+ do_label && (do_severity | do_text | do_action | do_tag)
+ ? ": " : "",
do_severity ? severity_rec->string : "",
- do_severity && do_text ? ": " : "",
+ do_severity && (do_text | do_action | do_tag) ? ": " : "",
do_text ? text : "",
- (do_label | do_severity | do_text) && (do_action | do_tag)
- ? "\n" : "",
+ do_text && (do_action | do_tag) ? "\n" : "",
do_action ? "TO FIX: " : "",
do_action ? action : "",
- do_action && do_tag ? " " : "",
+ do_action && do_tag ? " " : "",
do_tag ? tag : "") == EOF)
/* Oh, oh. An error occurred during the output. */
result = MM_NOMSG;
@@ -169,15 +169,15 @@ fmtmsg (long int classification, const char *label, int severity,
syslog (LOG_ERR, "%s%s%s%s%s%s%s%s%s%s\n",
do_label ? label : "",
- do_label && (do_severity | do_text) ? ": " : "",
+ do_label && (do_severity | do_text | do_action | do_tag)
+ ? ": " : "",
do_severity ? severity_rec->string : "",
- do_severity && do_text ? ": " : "",
+ do_severity && (do_text | do_action | do_tag) ? ": " : "",
do_text ? text : "",
- (do_label | do_severity | do_text) && (do_action | do_tag)
- ? "\n" : "",
+ do_text && (do_action | do_tag) ? "\n" : "",
do_action ? "TO FIX: " : "",
do_action ? action : "",
- do_action && do_tag ? " " : "",
+ do_action && do_tag ? " " : "",
do_tag ? tag : "");
}