summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8a14191)
A non-NULL but empty `what' would result in "fooerrno\n" without
separation. Improve the function's comment to try and make it obvious
how its out of order parameters appear.
/* advertise prints fmt and ap to stderr after flushing stdout.
/* advertise prints fmt and ap to stderr after flushing stdout.
- * If invo_name isn't NULL or empty, it precedes the output seperated by ": ".
- * If what isn't NULL, errno as a string is appended.
- * A non-empty what separates fmt from errno, surrounded by " " and ": ".
- * BUG: No space separator before errno if what is "".
- * If tail isn't NULL or empty then ", " and tail are appended
- * before the finishing "\n".
- * In summary: "invo_name: fmt what: errno, tail\n". */
+ * If invo_name isn't NULL or empty then "invo_name: " precedes fmt.
+ * If what isn't NULL or empty then " what" is appended.
+ * If what isn't NULL then ": errno" is appended.
+ * If tail isn't NULL or empty then ", tail" is appended.
+ * A "\n" finishes the output to stderr.
+ * In summary: "[invo_name: ]fmt[[ what]: errno][, tail]\n". */
void
advertise (const char *what, char *tail, const char *fmt, va_list ap)
{
void
advertise (const char *what, char *tail, const char *fmt, va_list ap)
{
if (*what) {
ADD_LITERAL(" ");
ADD_VAR((void *)what);
if (*what) {
ADD_LITERAL(" ");
ADD_VAR((void *)what);
err = strerror(eindex);
if (!err) {
/* this shouldn't happen, but we'll test for it just in case */
err = strerror(eindex);
if (!err) {
/* this shouldn't happen, but we'll test for it just in case */