From: Ralph Corderoy Date: Mon, 17 Apr 2017 09:42:09 +0000 (+0100) Subject: Replace advise(NULL, fmt, ...) with inform(fmt, ...). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/8a14191c0a0ad15bb8f35b49748c75c1e0a8c2f4?hp=1824820f0dcdcf5f96fb4c6ac0c84e86a26d0e63 Replace advise(NULL, fmt, ...) with inform(fmt, ...). --- diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 78f83556..c8bea5b8 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -457,7 +457,7 @@ sm_winit (char *from, int smtputf8, int eightbit) if (EHLOset ("8BITMIME") && EHLOset ("SMTPUTF8")) { mail_parameters = " BODY=8BITMIME SMTPUTF8"; } else { - advise (NULL, "SMTP server does not support %s, not sending.\n" + inform("SMTP server does not support %s, not sending.\n" "Rebuild message with 7-bit headers, WITHOUT -headerencoding utf-8.", EHLOset ("SMTPUTF8") ? "8BITMIME" : "SMTPUTF8"); sm_end (NOTOK); @@ -469,7 +469,7 @@ sm_winit (char *from, int smtputf8, int eightbit) if (EHLOset ("8BITMIME")) { mail_parameters = " BODY=8BITMIME"; } else { - advise (NULL, "SMTP server does not support 8BITMIME, not sending.\n" + inform("SMTP server does not support 8BITMIME, not sending.\n" "Suggest encoding message for 7-bit transport by setting your\n" "locale to C, and/or specifying *b64 in mhbuild directives."); sm_end (NOTOK); diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 49953f61..86b18a14 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -352,7 +352,7 @@ ismymbox (struct mailname *np) } } if (oops) - advise (NULL, "please fix the %s: entry in your %s file", + inform("please fix the %s: entry in your %s file", "alternate-mailboxes", mh_profile); } diff --git a/sbr/ambigsw.c b/sbr/ambigsw.c index 15ff34cb..ba6485f8 100644 --- a/sbr/ambigsw.c +++ b/sbr/ambigsw.c @@ -13,6 +13,6 @@ void ambigsw (const char *arg, const struct swit *swp) { - advise (NULL, "-%s ambiguous. It matches", arg); + inform("-%s ambiguous. It matches", arg); print_sw (arg, swp, "-", stderr); } diff --git a/sbr/base64.c b/sbr/base64.c index a1e54c92..8591384f 100644 --- a/sbr/base64.c +++ b/sbr/base64.c @@ -260,7 +260,7 @@ decodeBase64 (const char *encoded, unsigned char **decoded, size_t *len, } if (skip || (((unsigned char) *cp) & 0x80) || (value = b642nib[((unsigned char) *cp) & 0x7f]) > 0x3f) { - advise (NULL, "invalid BASE64 encoding in %s", cp); + inform("invalid BASE64 encoding in %s", cp); charstring_free (decoded_c); *decoded = NULL; @@ -315,7 +315,7 @@ test_end: /* Show some context for the error. */ for (i = 0; i < 20 && cp > encoded; ++i, --cp) {} - advise (NULL, "premature ending (bitno %d) near %s", bitno, + inform("premature ending (bitno %d) near %s", bitno, cp ? cp : encoded); charstring_free (decoded_c); *decoded = NULL; @@ -355,7 +355,7 @@ hexify (const unsigned char *input, size_t len, char **output) { const int num = snprintf(s, sizeof s, "[0x%02x]", *cp); if (num <= 0 || (unsigned int) num >= sizeof s) { - advise (NULL, "hexify failed to write nonprintable character, needed %d bytes", num + 1); + inform("hexify failed to write nonprintable character, needed %d bytes", num + 1); } else { charstring_append_cstring (tmp, s); } diff --git a/sbr/context_foil.c b/sbr/context_foil.c index e8407066..9aa02dba 100644 --- a/sbr/context_foil.c +++ b/sbr/context_foil.c @@ -47,11 +47,11 @@ context_foil (char *path) NEW(np); m_defs = np; if (!(np->n_name = strdup ("Path"))) { - advise (NULL, "strdup failed"); + inform("strdup failed"); return -1; } if (!(np->n_field = strdup (path))) { - advise (NULL, "strdup failed"); + inform("strdup failed"); return -1; } np->n_context = 0; @@ -59,7 +59,7 @@ context_foil (char *path) if (mypath == NULL && (mypath = getenv ("HOME")) != NULL) if (!(mypath = strdup (mypath))) { - advise (NULL, "strdup failed"); + inform("strdup failed"); return -1; } } diff --git a/sbr/datetime.c b/sbr/datetime.c index fb7f7c29..ba64e4d4 100644 --- a/sbr/datetime.c +++ b/sbr/datetime.c @@ -75,7 +75,7 @@ parse_datetime (const char *datetime, const char *zone, int dst, if (items_matched == 7) { /* The 'Z' must be capital according to RFC 5545 Sec. 3.3.5. */ if (utc_indicator != 'Z') { - advise (NULL, "%s has invalid timezone indicator of 0x%x", + inform("%s has invalid timezone indicator of 0x%x", datetime, utc_indicator); return NOTOK; } @@ -177,7 +177,7 @@ load_timezones (const contentline *clines) { params->start_dt = tws.tw_clock; } } else { - advise (NULL, "failed to parse start time %s for %s", + inform("failed to parse start time %s for %s", params->dtstart, in_standard ? "standard" : "daylight"); return NULL; @@ -360,7 +360,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { if (parse_datetime (node->value, NULL, 0, &tws[0]) == OK) { return strdup (dasctime (&tws[0], 0)); } - advise (NULL, "unable to parse datetime %s", node->value); + inform("unable to parse datetime %s", node->value); return NULL; } @@ -382,7 +382,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { if (tz) { free(dt_timezone); } else { - advise (NULL, "did not find VTIMEZONE section for %s", dt_timezone); + inform("did not find VTIMEZONE section for %s", dt_timezone); free(dt_timezone); return NULL; } @@ -424,7 +424,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { } if (transition[0] < transition[1]) { - advise (NULL, "format_datetime() requires that daylight " + inform("format_datetime() requires that daylight " "saving time transition precede standard time " "transition"); return NULL; @@ -434,7 +434,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { 0, &tws[0]) == OK) { dt[0] = tws[0].tw_clock; } else { - advise (NULL, "unable to parse datetime %s", node->value); + inform("unable to parse datetime %s", node->value); return NULL; } @@ -447,7 +447,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { &tws[1]) == OK) { dt[1] = tws[1].tw_clock; } else { - advise (NULL, "unable to parse datetime %s", + inform("unable to parse datetime %s", node->value); return NULL; } @@ -459,7 +459,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { if (dst) { if (tz->daylight_params.start_dt > 0 && dt[dst] < tz->daylight_params.start_dt) { - advise (NULL, "date-time of %s is before VTIMEZONE start " + inform("date-time of %s is before VTIMEZONE start " "of %s", node->value, tz->daylight_params.dtstart); return NULL; @@ -467,7 +467,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { } else { if (tz->standard_params.start_dt > 0 && dt[dst] < tz->standard_params.start_dt) { - advise (NULL, "date-time of %s is before VTIMEZONE start " + inform("date-time of %s is before VTIMEZONE start " "of %s", node->value, tz->standard_params.dtstart); return NULL; @@ -475,12 +475,12 @@ format_datetime (tzdesc_t timezones, const contentline *node) { } } else { if (! tp_std) { - advise (NULL, "unsupported date-time format: %s", + inform("unsupported date-time format: %s", tz->standard_params.dtstart); return NULL; } if (! tp_dt) { - advise (NULL, "unsupported date-time format: %s", node->value); + inform("unsupported date-time format: %s", node->value); return NULL; } } diff --git a/sbr/encode_rfc2047.c b/sbr/encode_rfc2047.c index d1ccd2e9..d964cbde 100644 --- a/sbr/encode_rfc2047.c +++ b/sbr/encode_rfc2047.c @@ -107,7 +107,7 @@ encode_rfc2047(const char *name, char **value, int encoding, charset = write_charset_8bit(); if (strcasecmp(charset, "US-ASCII") == 0) { - advise(NULL, "Cannot use US-ASCII with 8 bit characters in header"); + inform("Cannot use US-ASCII with 8 bit characters in header"); return 1; } @@ -146,7 +146,7 @@ encode_rfc2047(const char *name, char **value, int encoding, eightbitcount + qpspecialcount, 0); default: - advise(NULL, "Internal error: unknown RFC-2047 encoding type"); + inform("Internal error: unknown RFC-2047 encoding type"); return 1; } } @@ -381,7 +381,7 @@ field_encode_base64(const char *name, char **value, const char *charset) numencode = strbase64(ENCODELINELIMIT - (q - linestart) - 2); if (numencode <= 0) { - advise(NULL, "Internal error: tried to encode %d characters " + inform("Internal error: tried to encode %d characters " "in base64", numencode); return 1; } @@ -405,7 +405,7 @@ field_encode_base64(const char *name, char **value, const char *charset) numencode--; if (numencode == 0) { - advise(NULL, "Internal error: could not find start of " + inform("Internal error: could not find start of " "UTF-8 character when base64 encoding header"); return 1; } @@ -413,7 +413,7 @@ field_encode_base64(const char *name, char **value, const char *charset) if (writeBase64raw((unsigned char *) p, numencode, (unsigned char *) q) != OK) { - advise(NULL, "Internal error: base64 encoding of header failed"); + inform("Internal error: base64 encoding of header failed"); return 1; } @@ -460,7 +460,7 @@ field_encode_base64(const char *name, char **value, const char *charset) if (writeBase64raw((unsigned char *) p, strlen(p), (unsigned char *) q) != OK) { - advise(NULL, "Internal error: base64 encoding of header failed"); + inform("Internal error: base64 encoding of header failed"); return 1; } @@ -574,7 +574,7 @@ field_encode_address(const char *name, char **value, int encoding, for (groupflag = 0; (mp = getname(*value)); ) { if ((mn = getm(mp, NULL, 0, errbuf, sizeof(errbuf))) == NULL) { - advise(NULL, "%s: %s", errbuf, mp); + inform("%s: %s", errbuf, mp); errflag++; continue; } @@ -632,7 +632,7 @@ field_encode_address(const char *name, char **value, int encoding, break; default: - advise(NULL, "Internal error: unknown RFC-2047 encoding type"); + inform("Internal error: unknown RFC-2047 encoding type"); errflag++; goto out; } @@ -658,7 +658,7 @@ field_encode_address(const char *name, char **value, int encoding, } if (mn->m_note[0] != '(' || mn->m_note[len - 1] != ')') { - advise(NULL, "Internal error: Invalid note field \"%s\"", + inform("Internal error: Invalid note field \"%s\"", mn->m_note); errflag++; goto out; @@ -695,7 +695,7 @@ field_encode_address(const char *name, char **value, int encoding, break; default: - advise(NULL, "Internal error: unknown RFC-2047 encoding type"); + inform("Internal error: unknown RFC-2047 encoding type"); errflag++; goto out; } diff --git a/sbr/ext_hook.c b/sbr/ext_hook.c index 186f77c3..d29c046a 100644 --- a/sbr/ext_hook.c +++ b/sbr/ext_hook.c @@ -28,7 +28,7 @@ ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2) switch (pid = fork()) { case -1: status = NOTOK; - advise(NULL, "external database may be out-of-date."); + inform("external database may be out-of-date."); break; case 0: @@ -50,7 +50,7 @@ ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2) if (did_message == 0) { char *msghook; if ((msghook = context_find("msg-hook")) != NULL) - advise(NULL, msghook); + inform(msghook); else { char errbuf[BUFSIZ]; snprintf(errbuf, sizeof(errbuf), "external hook \"%s\"", hook); diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index f7fcff2b..dbd09645 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -375,7 +375,7 @@ compile_error(char *str, char *cp) usr_fstring[i] = '_'; } - advise(NULL, "\"%s\": format compile error - %s", + inform("\"%s\": format compile error - %s", &usr_fstring[errpos-errctx], str); adios (NULL, "%*s", errctx+1, "^"); } diff --git a/sbr/folder_addmsg.c b/sbr/folder_addmsg.c index 806cf929..eeeaace1 100644 --- a/sbr/folder_addmsg.c +++ b/sbr/folder_addmsg.c @@ -52,13 +52,13 @@ folder_addmsg (struct msgs **mpp, char *msgfile, int selected, */ if (msgnum > mp->hghoff) { if (!(mp = folder_realloc (mp, mp->lowoff, msgnum + 100))) { - advise (NULL, "unable to allocate folder storage"); + inform("unable to allocate folder storage"); return -1; } *mpp = mp; } else if (msgnum < mp->lowoff) { if (!(mp = folder_realloc (mp, msgnum, mp->hghoff))) { - advise (NULL, "unable to allocate folder storage"); + inform("unable to allocate folder storage"); return -1; } *mpp = mp; @@ -165,7 +165,7 @@ folder_addmsg (struct msgs **mpp, char *msgfile, int selected, */ if (linkerr == EXDEV || linkerr == EPERM) { if (stat (newmsg, &st1) == 0) { - advise (NULL, "message %s:%s already exists", mp->foldpath, newmsg); + inform("message %s:%s already exists", mp->foldpath, newmsg); return -1; } diff --git a/sbr/folder_pack.c b/sbr/folder_pack.c index b0bc67b3..b2f79532 100644 --- a/sbr/folder_pack.c +++ b/sbr/folder_pack.c @@ -38,7 +38,7 @@ folder_pack (struct msgs **mpp, int verbose) if ((mp = folder_realloc (mp, 1, mp->hghmsg))) *mpp = mp; else { - advise (NULL, "unable to allocate folder storage"); + inform("unable to allocate folder storage"); return -1; } } diff --git a/sbr/icalendar.l b/sbr/icalendar.l index 016c6ebd..2250f4ea 100644 --- a/sbr/icalendar.l +++ b/sbr/icalendar.l @@ -258,7 +258,7 @@ folded-value {VALUE-CHAR}*({fold}{VALUE-CHAR}*)+ . { /* By default, flex will just pass unmatched text. Catch it instead. */ - advise (NULL, "unexpected input: |%s|\n", icaltext); + inform("unexpected input: |%s|\n", icaltext); } <> { diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 9fbcbd78..cac80c1b 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -560,7 +560,7 @@ lockit (struct lockinfo *li) curlock = li->curlock; if ((tmpfile = m_mktemp(li->tmplock, &fd, NULL)) == NULL) { - advise(NULL, "unable to create temporary file in %s", li->tmplock); + inform("unable to create temporary file in %s", li->tmplock); return -1; } diff --git a/sbr/m_convert.c b/sbr/m_convert.c index 82ab07e3..3e9433b0 100644 --- a/sbr/m_convert.c +++ b/sbr/m_convert.c @@ -77,7 +77,7 @@ m_convert (struct msgs *mp, char *name) cp = delimp; if (*cp != '\0' && *cp != '-' && *cp != ':' && *cp != '=') { badelim: - advise (NULL, "illegal argument delimiter: `%c'(0%o)", *delimp, *delimp); + inform("illegal argument delimiter: `%c'(0%o)", *delimp, *delimp); return 0; } @@ -87,28 +87,28 @@ badelim: badmsg: switch (err) { case BADMSG: - advise (NULL, "no %s message", cp); + inform("no %s message", cp); break; case BADNUM: - advise (NULL, "message %s doesn't exist", cp); + inform("message %s doesn't exist", cp); break; case BADRNG: - advise (NULL, "message %s out of range 1-%d", cp, mp->hghmsg); + inform("message %s out of range 1-%d", cp, mp->hghmsg); break; case BADLST: badlist: - advise (NULL, "bad message list %s", name); + inform("bad message list %s", name); break; case BADNEW: - advise (NULL, "folder full, no %s message", name); + inform("folder full, no %s message", name); break; default: - advise (NULL, "no messages match specification"); + inform("no messages match specification"); } return 0; } @@ -119,7 +119,7 @@ badlist: goto badelim; if (first > mp->hghmsg || last < mp->lowmsg) { rangerr: - advise (NULL, "no messages in range %s", name); + inform("no messages in range %s", name); return 0; } @@ -179,7 +179,7 @@ rangerr: } } else { /* looking for the nth message. if not enough, fail. */ if (last < mp->lowmsg || last > mp->hghmsg) { - advise (NULL, "no such message"); + inform("no such message"); return 0; } first = last; @@ -213,9 +213,9 @@ single: || first < mp->lowmsg || !(does_exist (mp, first))) { if (!strcmp (name, "cur") || !strcmp (name, ".")) - advise (NULL, "no %s message", name); + inform("no %s message", name); else - advise (NULL, "message %d doesn't exist", first); + inform("message %d doesn't exist", first); return 0; } } @@ -505,6 +505,6 @@ attr (struct msgs *mp, char *cp) if (first || just_one) return BADMSG; - advise (NULL, "sequence %s %s", cp, inverted ? "full" : "empty"); + inform("sequence %s %s", cp, inverted ? "full" : "empty"); return -1; } diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index 4976b1c5..f17ad417 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -548,7 +548,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, int next_char; if (c == EOF || (next_char = Peek (s)) == EOF) { *bufsz = *cp = *buf = 0; - advise (NULL, "eof encountered in field \"%s\"", name); + inform("eof encountered in field \"%s\"", name); leave_getfld (s); return s->state = FMTERR; } @@ -574,7 +574,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, if (*bufsz < n + 1) { /* No, it can't. Oh well, guess we'll blow up. */ *bufsz = *cp = *buf = 0; - advise (NULL, "eol encountered in field \"%s\"", name); + inform("eol encountered in field \"%s\"", name); s->state = FMTERR; break; } @@ -596,7 +596,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, it had read. It's in c, use it. */ *cp++ = c; *bufsz = *cp = *buf = 0; - advise (NULL, "field name \"%s\" exceeds %d bytes", name, + inform("field name \"%s\" exceeds %d bytes", name, NAMESZ - 2); s->state = LENERR; break; diff --git a/sbr/mime_type.c b/sbr/mime_type.c index e4f3e5b8..b235bc7c 100644 --- a/sbr/mime_type.c +++ b/sbr/mime_type.c @@ -87,7 +87,7 @@ mime_type(const char *file_name) { int binary = 0, c; if (!(fp = fopen(file_name, "r"))) { - advise (NULL, "unable to access file \"%s\"", file_name); + inform("unable to access file \"%s\"", file_name); return NULL; } @@ -121,7 +121,7 @@ get_file_info(const char *proc, const char *file_name) { if ((cp = strchr(file_name, '\''))) { /* file_name contains a single quote. */ if (strchr(file_name, '"')) { - advise(NULL, "filenames containing both single and double quotes " + inform("filenames containing both single and double quotes " "are unsupported for attachment"); return NULL; } @@ -162,12 +162,12 @@ get_file_info(const char *proc, const char *file_name) { (void) pclose(fp); } else { - advise(NULL, "no output from %s", cmd); + inform("no output from %s", cmd); } free(cmd); } else { - advise(NULL, "concat with \"%s\" failed, out of memory?", proc); + inform("concat with \"%s\" failed, out of memory?", proc); } return cp ? strdup(cp) : NULL; diff --git a/sbr/oauth.c b/sbr/oauth.c index 2180be87..21035ac2 100755 --- a/sbr/oauth.c +++ b/sbr/oauth.c @@ -166,7 +166,7 @@ mh_oauth_do_xoauth(const char *user, const char *svc, unsigned char **oauth_res, if (mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT) { adios(NULL, "credentials rejected -- run mhlogin -saslmech xoauth2 -authservice %s", svc); } - advise(NULL, "error refreshing OAuth2 token"); + inform("error refreshing OAuth2 token"); adios(NULL, mh_oauth_get_err_string(ctx)); } diff --git a/sbr/push.c b/sbr/push.c index c4d0e405..03e8a456 100644 --- a/sbr/push.c +++ b/sbr/push.c @@ -23,7 +23,7 @@ push(void) switch (pid) { case -1: /* fork error */ - advise (NULL, "unable to fork, so can't push..."); + inform("unable to fork, so can't push..."); break; case 0: diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 2bd8d63e..ab47f13a 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -107,7 +107,7 @@ ruserpass(const char *host, char **aname, char **apass, int flags) (stb.st_mode & 077) != 0) { /* We make this a fatal error to force the user to correct it. */ - advise(NULL, "group or other permissions, %#o, " + inform("group or other permissions, %#o, " "forbidden: %s", stb.st_mode, credentials_file); adios(NULL, "Remove password or correct file " "permissions."); diff --git a/sbr/seq_add.c b/sbr/seq_add.c index 47085f88..3dc74501 100644 --- a/sbr/seq_add.c +++ b/sbr/seq_add.c @@ -53,7 +53,7 @@ seq_addsel (struct msgs *mp, char *cp, int public, int zero) */ if (new_seq) { if (!(svector_push_back (mp->msgattrs, strdup (cp)))) { - advise (NULL, "strdup failed"); + inform("strdup failed"); return 0; } } @@ -140,7 +140,7 @@ seq_addmsg (struct msgs *mp, char *cp, int msgnum, int public, int zero) */ if (new_seq) { if (!(svector_push_back (mp->msgattrs, strdup (cp)))) { - advise (NULL, "strdup failed"); + inform("strdup failed"); return 0; } } diff --git a/sbr/seq_del.c b/sbr/seq_del.c index 670872ef..57c1fa78 100644 --- a/sbr/seq_del.c +++ b/sbr/seq_del.c @@ -51,7 +51,7 @@ seq_delsel (struct msgs *mp, char *cp, int public, int zero) */ if (new_seq) { if (!(svector_push_back (mp->msgattrs, strdup (cp)))) { - advise (NULL, "strdup failed"); + inform("strdup failed"); return 0; } } @@ -66,7 +66,7 @@ seq_delsel (struct msgs *mp, char *cp, int public, int zero) } } else { if (new_seq) { - advise (NULL, "no such sequence as %s", cp); + inform("no such sequence as %s", cp); return 0; } } @@ -129,6 +129,6 @@ seq_delmsg (struct msgs *mp, char *cp, int msgnum) } } - advise (NULL, "no such sequence as %s", cp); + inform("no such sequence as %s", cp); return 0; } diff --git a/sbr/seq_nameok.c b/sbr/seq_nameok.c index 328bd5c2..3942b0e3 100644 --- a/sbr/seq_nameok.c +++ b/sbr/seq_nameok.c @@ -16,7 +16,7 @@ seq_nameok (char *s) char *pp; if (s == NULL || *s == '\0') { - advise (NULL, "empty sequence name"); + inform("empty sequence name"); return 0; } @@ -30,7 +30,7 @@ seq_nameok (char *s) strcmp (s, "last") && strcmp (s, "prev") && strcmp (s, "next"))) { - advise (NULL, "illegal sequence name: %s", s); + inform("illegal sequence name: %s", s); return 0; } @@ -39,7 +39,7 @@ seq_nameok (char *s) * an alphabetic character ... */ if (!isalpha ((unsigned char) *s)) { - advise (NULL, "illegal sequence name: %s", s); + inform("illegal sequence name: %s", s); return 0; } @@ -48,7 +48,7 @@ seq_nameok (char *s) */ for (pp = s + 1; *pp; pp++) if (!isalnum ((unsigned char) *pp)) { - advise (NULL, "illegal sequence name: %s", s); + inform("illegal sequence name: %s", s); return 0; } diff --git a/sbr/utils.c b/sbr/utils.c index d27fa81d..7e4dd3c9 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -357,7 +357,7 @@ nmh_strcasestr (const char *s1, const char *s2) { void trunccpy(char *dst, const char *src, size_t size) { if (!size) { - advise(NULL, "trunccpy: zero-length destination: \"%.20s\"", + inform("trunccpy: zero-length destination: \"%.20s\"", src ? src : "null"); abort(); } diff --git a/uip/comp.c b/uip/comp.c index 7ca48dbc..6f685c76 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -359,7 +359,7 @@ try_it_again: i = YESW; break; default: - advise (NULL, "say what?"); + inform("say what?"); break; } } diff --git a/uip/dist.c b/uip/dist.c index f846b74d..e2504d4b 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -251,7 +251,7 @@ try_it_again: i = YESW; break; default: - advise (NULL, "say what?"); + inform("say what?"); break; } } diff --git a/uip/distsbr.c b/uip/distsbr.c index 30523778..bdea4b14 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -56,7 +56,7 @@ distout (char *drft, char *msgnam, char *backup) if (uprf (name, "distribution-")) snprintf (name, sizeof(name), "%s%s", "Resent", &name[12]); if (!uprf (name, "resent")) { - advise (NULL, BADHDR, "draft", name); + inform(BADHDR, "draft", name); goto leave_bad; } if (state == FLD) @@ -74,7 +74,7 @@ distout (char *drft, char *msgnam, char *backup) case BODY: for (dp = buffer; *dp; dp++) if (!isspace ((unsigned char) *dp)) { - advise (NULL, BADTXT, "draft"); + inform(BADTXT, "draft"); goto leave_bad; } @@ -83,7 +83,7 @@ distout (char *drft, char *msgnam, char *backup) case LENERR: case FMTERR: - advise (NULL, BADRFT, "draft"); + inform(BADRFT, "draft"); leave_bad: ; fclose (ifp); fclose (ofp); @@ -102,7 +102,7 @@ process: ; fflush (ofp); if (!resent) { - advise (NULL, BADMSG, "draft"); + inform(BADMSG, "draft"); fclose (ofp); (void) m_unlink (drft); if (rename (backup, drft) == NOTOK) diff --git a/uip/forw.c b/uip/forw.c index c03c7b40..50e14bbb 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -333,7 +333,7 @@ try_it_again: i = YESW; break; default: - advise (NULL, "say what?"); + inform("say what?"); break; } } diff --git a/uip/inc.c b/uip/inc.c index 0f7c4a0d..b6d8e363 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -587,7 +587,7 @@ go_to_it: if (audfile) { int i; if ((i = stat (audfile, &st)) == NOTOK) - advise (NULL, "Creating Receive-Audit: %s", audfile); + inform("Creating Receive-Audit: %s", audfile); if ((aud = fopen (audfile, "a")) == NULL) adios (audfile, "unable to append to"); else if (i == NOTOK) @@ -762,15 +762,15 @@ go_to_it: case SCNERR: if (aud) fputs ("inc aborted!\n", aud); - advise (NULL, "aborted!"); /* doesn't clean up locks! */ + inform("aborted!"); /* doesn't clean up locks! */ break; case SCNNUM: - advise (NULL, "BUG in %s, number out of range", invo_name); + inform("BUG in %s, number out of range", invo_name); break; default: - advise (NULL, "BUG in %s, scan() botch (%d)", invo_name, incerr); + inform("BUG in %s, scan() botch (%d)", invo_name, incerr); break; case SCNMSG: @@ -917,7 +917,7 @@ go_to_it: if (inc_type == INC_FILE && Maildir == NULL) { if (trnflag) { if (stat (newmail, &st) != NOTOK && s1.st_mtime != st.st_mtime) - advise (NULL, "new messages have arrived!\007"); + inform("new messages have arrived!\007"); else { int newfd; if ((newfd = creat (newmail, 0600)) != NOTOK) @@ -956,7 +956,7 @@ go_to_it: if (msgnum >= mp2->hghoff && !(mp2 = folder_realloc (mp2, mp2->lowoff, msgnum + 1))) { - advise (NULL, "unable to reallocate folder storage"); + inform("unable to reallocate folder storage"); goto skip; } diff --git a/uip/mhcachesbr.c b/uip/mhcachesbr.c index 7ac0a0de..a2fad2c9 100644 --- a/uip/mhcachesbr.c +++ b/uip/mhcachesbr.c @@ -94,19 +94,19 @@ cache_content (CT ct) CE ce = &ct->c_cefile; if (!ct->c_id) { - advise (NULL, "no %s: field in %s", ID_FIELD, ct->c_file); + inform("no %s: field in %s", ID_FIELD, ct->c_file); return; } if (!ce) { - advise (NULL, "unable to decode %s", ct->c_file); + inform("unable to decode %s", ct->c_file); return; } if (find_cache (NULL, wcachesw != CACHE_NEVER ? wcachesw : CACHE_ASK, &cachetype, ct->c_id, cachefile, sizeof(cachefile)) == NOTOK) { - advise (NULL, "unable to cache %s's contents", ct->c_file); + inform("unable to cache %s's contents", ct->c_file); return; } if (wcachesw != CACHE_NEVER && wcachesw != CACHE_ASK) { diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index a0c6efda..5a777010 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -372,7 +372,7 @@ main (int argc, char **argv) { set_text_ctparams(ct, fx.decodetypes, fx.lf_line_endings); *ctp++ = ct; } else { - advise (NULL, "unable to parse message from file %s", file); + inform("unable to parse message from file %s", file); status = NOTOK; /* If there's an outfile, pass the input message unchanged, so the @@ -386,7 +386,7 @@ main (int argc, char **argv) { } if (copy_input_to_output (file, infp, outfile, outfp) != OK) { - advise (NULL, "unable to copy message to %s, " + inform("unable to copy message to %s, " "it might be lost\n", outfile); } @@ -442,7 +442,7 @@ main (int argc, char **argv) { set_text_ctparams(ct, fx.decodetypes, fx.lf_line_endings); *ctp++ = ct; } else { - advise (NULL, "unable to parse message %s", msgnam); + inform("unable to parse message %s", msgnam); status = NOTOK; /* If there's an outfile, pass the input message @@ -465,10 +465,8 @@ main (int argc, char **argv) { if (copy_input_to_output (input_filename, infp, outfile, outfp) != OK) { - advise (NULL, - "unable to copy message to %s, " - "it might be lost\n", - outfile); + inform("unable to copy message to %s, " + "it might be lost\n", outfile); } fclose (infp); @@ -608,7 +606,7 @@ mhfixmsgsbr (CT *ctp, char *maildir, const fix_transformations *fx, to the output. */ if (copy_input_to_output (input_filename, *infp, outfile, *outfp) != OK) { - advise (NULL, "unable to copy message to %s, it might be lost\n", + inform("unable to copy message to %s, it might be lost\n", outfile); } } @@ -692,16 +690,16 @@ fix_boundary (CT *ct, int *message_mods) { } } else { *ct = NULL; - advise (NULL, "unable to parse fixed part"); + inform("unable to parse fixed part"); status = NOTOK; } free (filename); } else { - advise (NULL, "unable to replace broken boundary"); + inform("unable to replace broken boundary"); status = NOTOK; } } else { - advise (NULL, "unable to create temporary file in %s", + inform("unable to create temporary file in %s", get_temp_dir()); status = NOTOK; } @@ -826,7 +824,7 @@ replace_boundary (CT ct, char *file, char *boundary) { int status = OK; if (ct->c_file == NULL) { - advise (NULL, "missing input filename"); + inform("missing input filename"); return NOTOK; } @@ -898,12 +896,12 @@ replace_boundary (CT ct, char *file, char *boundary) { case LENERR: case FMTERR: - advise (NULL, "message format error in component #%d", compnum); + inform("message format error in component #%d", compnum); status = NOTOK; break; default: - advise (NULL, "getfld() returned %d", state); + inform("getfld() returned %d", state); status = NOTOK; break; } @@ -985,7 +983,7 @@ fix_types (CT ct, svector_t fixtypes, int *message_mods) { *cp = '\0'; ct_subtype = mh_xstrdup(++cp); } else { - advise (NULL, "missing / in MIME type of %s %s", + inform("missing / in MIME type of %s %s", ct->c_file, ct->c_partno); free (ct_type); return NOTOK; @@ -1000,7 +998,7 @@ fix_types (CT ct, svector_t fixtypes, int *message_mods) { ct->c_ctinfo.ci_subtype = ct_subtype; if (! replace_substring (&ct->c_ctline, type, ct_type_subtype)) { - advise (NULL, "did not find %s in %s", + inform("did not find %s in %s", type, ct->c_ctline); } @@ -1018,7 +1016,7 @@ fix_types (CT ct, svector_t fixtypes, int *message_mods) { } break; } else { - advise (NULL, "did not find %s in %s", + inform("did not find %s in %s", type, hf->value); } } @@ -1337,9 +1335,8 @@ ensure_text_plain (CT *ct, CT parent, int *message_mods, int replacetextplain) { parent->c_ctinfo.ci_subtype = mh_xstrdup("alternative"); if (! replace_substring (&parent->c_ctline, "/related", "/alternative")) { - advise (NULL, - "did not find multipart/related in %s", - parent->c_ctline); + inform("did not find multipart/related in %s", + parent->c_ctline); } /* Update Content-Type header field. */ @@ -1359,7 +1356,7 @@ ensure_text_plain (CT *ct, CT parent, int *message_mods, int replacetextplain) { remove_parameter (hf->value, "type"); break; } else { - advise (NULL, "did not find multipart/" + inform("did not find multipart/" "related in header %s", hf->value); } @@ -1493,7 +1490,7 @@ build_text_plain_part (CT encoded_part) { /* This m_mktemp2() call closes the temp file. */ if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, NULL)) == NULL) { - advise (NULL, "unable to create temporary file in %s", + inform("unable to create temporary file in %s", get_temp_dir()); } else { tmp_plain_file = mh_xstrdup (tempfile); @@ -1658,14 +1655,14 @@ reformat_part (CT ct, char *file, char *type, char *subtype, int c_type) { /* Check for invo_name-format-type/subtype. */ if ((cf = context_find_by_type ("format", type, subtype)) == NULL) { if (verbosw) { - advise (NULL, "Don't know how to convert %s, there is no " + inform("Don't know how to convert %s, there is no " "%s-format-%s/%s profile entry", ct->c_file, invo_name, type, subtype); } return NOTOK; } if (strchr (cf, '>')) { - advise (NULL, "'>' prohibited in \"%s\",\nplease fix your " + inform("'>' prohibited in \"%s\",\nplease fix your " "%s-format-%s/%s profile entry", cf, invo_name, type, subtype ? subtype : ""); @@ -1790,7 +1787,7 @@ build_multipart_alt (CT first_alt, CT new_part, int type, int subtype) { } if (found_boundary) { - advise (NULL, "giving up trying to find a unique boundary"); + inform("giving up trying to find a unique boundary"); free_content (ct); return NULL; } @@ -2599,7 +2596,7 @@ fix_filename_param (char *name, char *value, PM *first_pm, PM *last_pm) { replace_param (first_pm, last_pm, name, decoded, 0); fixed = 1; } else { - advise (NULL, "failed to decode %s parameter %s", name, value); + inform("failed to decode %s parameter %s", name, value); } } @@ -2664,7 +2661,7 @@ fix_filename_encoding (CT ct) { free((void *)new_params); /* Cast away const. Sigh. */ free((void *)params); } else { - advise (NULL, "did not find semicolon in %s:%s\n", + inform("did not find semicolon in %s:%s\n", hf->name, hf->value); } } diff --git a/uip/mhlogin.c b/uip/mhlogin.c index 4a42aea2..6c17134c 100644 --- a/uip/mhlogin.c +++ b/uip/mhlogin.c @@ -109,7 +109,7 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) code = geta(); } if (cred == NULL) { - advise(NULL, "error exchanging code for OAuth2 token"); + inform("error exchanging code for OAuth2 token"); adios(NULL, mh_oauth_get_err_string(ctx)); } diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index f07d786d..d5d32b17 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -771,7 +771,7 @@ evalvar (struct mcomp *c1) return 1; if (! c1->c_name || strcasecmp (c1->c_name, "body")) { - advise (NULL, "format filters are currently only supported on " + inform("format filters are currently only supported on " "the \"body\" component"); return 1; } @@ -802,7 +802,7 @@ ptoi (char *name, int *i) char *cp; if (*parptr++ != '=' || !*(cp = parse ())) { - advise (NULL, "missing argument to variable %s", name); + inform("missing argument to variable %s", name); return 1; } @@ -817,7 +817,7 @@ ptos (char *name, char **s) char c, *cp; if (*parptr++ != '=') { - advise (NULL, "missing argument to variable %s", name); + inform("missing argument to variable %s", name); return 1; } @@ -1100,7 +1100,7 @@ mhlfile (FILE *fp, char *mname, int ofilen, int ofilec) case LENERR: case FMTERR: - advise (NULL, "format error in message %s", mname); + inform("format error in message %s", mname); exitstat++; m_getfld_state_destroy (&gstate); return; diff --git a/uip/mhmisc.c b/uip/mhmisc.c index 0f466c42..63ea15a1 100644 --- a/uip/mhmisc.c +++ b/uip/mhmisc.c @@ -151,7 +151,7 @@ losing_directory: if (!answer) goto losing_directory; if (!makedir (file)) { - advise (NULL, "unable to create directory %s", file); + inform("unable to create directory %s", file); goto losing_directory; } } @@ -250,7 +250,7 @@ content_error (char *what, CT ct, char *fmt, ...) errs = add (buffer, errs); } else { - advise (NULL, "%s", buffer); + inform("%s", buffer); } } diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 638cf979..f3d560da 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -175,13 +175,13 @@ output_content (CT ct, FILE *out) putc ('\n', out); result = write8Bit (ct, out); } else { - advise (NULL, "can't handle binary transfer encoding in content"); + inform("can't handle binary transfer encoding in content"); result = NOTOK; } break; default: - advise (NULL, "unknown transfer encoding in content"); + inform("unknown transfer encoding in content"); result = NOTOK; break; } diff --git a/uip/mhparam.c b/uip/mhparam.c index edbefd78..fb457848 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -196,10 +196,10 @@ main(int argc, char **argv) struct node *np; if (compp) - advise(NULL, "profile-components ignored with -all"); + inform("profile-components ignored with -all"); if (components >= 0) - advise(NULL, "-%scomponents ignored with -all", + inform("-%scomponents ignored with -all", components ? "" : "no"); /* Print all entries in context/profile list. That does not diff --git a/uip/mhparse.c b/uip/mhparse.c index a2dcb88c..2be97603 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -250,7 +250,7 @@ parse_mime (char *file) return NULL; } else if (S_ISDIR(statbuf.st_mode)) { /* Don't try to parse a directory. */ - advise (NULL, "%s is a directory", file); + inform("%s is a directory", file); return NULL; } else if ((fp = fopen (file, "r")) == NULL) { advise (file, "unable to read"); @@ -260,7 +260,7 @@ parse_mime (char *file) if (!(ct = get_content (fp, file, 1))) { if (is_stdin) (void) m_unlink (file); - advise (NULL, "unable to decode %s", file); + inform("unable to decode %s", file); return NULL; } @@ -420,7 +420,7 @@ get_content (FILE *in, char *file, int toplevel) ct->c_vrsn = vrsn; } else { if (! suppress_multiple_mime_version_warning) - advise (NULL, "message %s has multiple %s: fields", + inform("message %s has multiple %s: fields", ct->c_file, VRSN_FIELD); free(vrsn); } @@ -432,7 +432,7 @@ get_content (FILE *in, char *file, int toplevel) /* Check if we've already seen a Content-Type header */ if (ct->c_ctline) { - advise (NULL, "message %s has multiple %s: fields", + inform("message %s has multiple %s: fields", ct->c_file, TYPE_FIELD); goto next_header; } @@ -463,7 +463,7 @@ get_content (FILE *in, char *file, int toplevel) * Content-Transfer-Encoding field */ if (ct->c_celine) { - advise (NULL, "message %s has multiple %s: fields", + inform("message %s has multiple %s: fields", ct->c_file, ENCODING_FIELD); goto next_header; } @@ -502,7 +502,7 @@ get_content (FILE *in, char *file, int toplevel) goto next_header; if (ct->c_digested) { - advise (NULL, "message %s has multiple %s: fields", + inform("message %s has multiple %s: fields", ct->c_file, MD5_FIELD); goto next_header; } @@ -666,7 +666,7 @@ get_ctinfo (char *cp, CT ct, int magic) *dp = c, cp = dp; if (!*ci->ci_type) { - advise (NULL, "invalid %s: field in message %s (empty type)", + inform("invalid %s: field in message %s (empty type)", TYPE_FIELD, ct->c_file); return NOTOK; } @@ -700,9 +700,8 @@ get_ctinfo (char *cp, CT ct, int magic) *dp = c, cp = dp; if (!*ci->ci_subtype) { - advise (NULL, - "invalid %s: field in message %s (empty subtype for \"%s\")", - TYPE_FIELD, ct->c_file, ci->ci_type); + inform("invalid %s: field in message %s (empty subtype for \"%s\")", + TYPE_FIELD, ct->c_file, ci->ci_type); return NOTOK; } to_lower(ci->ci_subtype); @@ -728,7 +727,7 @@ magic_skip: mh_xfree(ct->c_id); ct->c_id = NULL; if (!(dp = strchr(ct->c_id = ++cp, '>'))) { - advise (NULL, "invalid ID in message %s", ct->c_file); + inform("invalid ID in message %s", ct->c_file); return NOTOK; } c = *dp; @@ -753,7 +752,7 @@ magic_skip: if (*dp == ']') break; if (dp < cp) { - advise (NULL, "invalid description in message %s", ct->c_file); + inform("invalid description in message %s", ct->c_file); ct->c_descr = NULL; return NOTOK; } @@ -780,7 +779,7 @@ magic_skip: if (*dp == '}') break; if (dp < cp) { - advise (NULL, "invalid disposition in message %s", ct->c_file); + inform("invalid disposition in message %s", ct->c_file); ct->c_dispo = NULL; return NOTOK; } @@ -814,7 +813,7 @@ magic_skip: cp++; if (dp == cp) { - advise (NULL, "invalid null transfer encoding specification"); + inform("invalid null transfer encoding specification"); return NOTOK; } @@ -831,7 +830,7 @@ magic_skip: } if (ct->c_reqencoding == CE_UNKNOWN) { - advise (NULL, "invalid CTE specification: \"%s\"", dp); + inform("invalid CTE specification: \"%s\"", dp); return NOTOK; } @@ -857,9 +856,8 @@ magic_skip: } } else - advise (NULL, - "extraneous information in message %s's %s: field\n%*s(%s)", - ct->c_file, TYPE_FIELD, strlen(invo_name) + 2, "", cp); + inform("extraneous information in message %s's %s: field\n%*s(%s)", + ct->c_file, TYPE_FIELD, strlen(invo_name) + 2, "", cp); } return OK; @@ -925,9 +923,8 @@ get_dispo (char *cp, CT ct, int buildflag) return NOTOK; } } else if (*cp) { - advise (NULL, - "extraneous information in message %s's %s: field\n%*s(%s)", - ct->c_file, DISPO_FIELD, strlen(invo_name) + 2, "", cp); + inform("extraneous information in message %s's %s: field\n%*s(%s)", + ct->c_file, DISPO_FIELD, strlen(invo_name) + 2, "", cp); } if (buildflag) @@ -955,7 +952,7 @@ get_comment (const char *filename, const char *fieldname, char **ap, switch (c = *cp++) { case '\0': invalid: - advise (NULL, "invalid comment in message %s's %s: field", + inform("invalid comment in message %s's %s: field", filename, fieldname); return NOTOK; @@ -1135,9 +1132,8 @@ InitMultiPart (CT ct) /* complain if boundary parameter is missing */ if (!pm) { - advise (NULL, - "a \"boundary\" parameter is mandatory for \"%s/%s\" type in message %s's %s: field", - ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); + inform("a \"boundary\" parameter is mandatory for \"%s/%s\" type in message %s's %s: field", + ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } @@ -1149,7 +1145,7 @@ InitMultiPart (CT ct) for (cp = bp; isspace ((unsigned char) *cp); cp++) continue; if (!*cp) { - advise (NULL, "invalid \"boundary\" parameter for \"%s/%s\" type in message %s's %s: field", + inform("invalid \"boundary\" parameter for \"%s/%s\" type in message %s's %s: field", ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } @@ -1219,7 +1215,7 @@ end_part: } if (! suppress_bogus_mp_content_warning) { - advise (NULL, "bogus multipart content in message %s", ct->c_file); + inform("bogus multipart content in message %s", ct->c_file); } bogus_mp_content = 1; @@ -1437,10 +1433,9 @@ InitMessage (CT ct) if (sscanf (pm->pm_value, "%d", &p->pm_partno) != 1 || p->pm_partno < 1) { invalid_param: - advise (NULL, - "invalid %s parameter for \"%s/%s\" type in message %s's %s field", - pm->pm_name, ci->ci_type, ci->ci_subtype, - ct->c_file, TYPE_FIELD); + inform("invalid %s parameter for \"%s/%s\" type in message %s's %s field", + pm->pm_name, ci->ci_type, ci->ci_subtype, + ct->c_file, TYPE_FIELD); return NOTOK; } continue; @@ -1456,10 +1451,8 @@ invalid_param: if (!p->pm_partid || !p->pm_partno || (p->pm_maxno && p->pm_partno > p->pm_maxno)) { - advise (NULL, - "invalid parameters for \"%s/%s\" type in message %s's %s field", - ci->ci_type, ci->ci_subtype, - ct->c_file, TYPE_FIELD); + inform("invalid parameters for \"%s/%s\" type in message %s's %s field", + ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } } @@ -1644,9 +1637,8 @@ params_external (CT ct, int composing) } if (!e->eb_access) { - advise (NULL, - "invalid parameters for \"%s/%s\" type in message %s's %s field", - ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); + inform("invalid parameters for \"%s/%s\" type in message %s's %s field", + ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } @@ -2729,7 +2721,7 @@ openMail (CT ct, char **file) default: if (pidXwait (child_id, NULL) == OK) - advise (NULL, "request sent"); + inform("request sent"); break; } @@ -3290,10 +3282,8 @@ parse_header_attrs (const char *filename, const char *fieldname, if (*cp == 0) { if (! suppress_extraneous_trailing_semicolon_warning) { - advise (NULL, - "extraneous trailing ';' in message %s's %s: " - "parameter list", - filename, fieldname); + inform("extraneous trailing ';' in message %s's %s: " + "parameter list", filename, fieldname); } return DONE; } @@ -3305,10 +3295,9 @@ parse_header_attrs (const char *filename, const char *fieldname, for (up = dp; isspace ((unsigned char) *dp);) dp++; if (dp == cp || *dp != '=') { - advise (NULL, - "invalid parameter in message %s's %s: " - "field\n%*sparameter %s (error detected at offset %d)", - filename, fieldname, strlen(invo_name) + 2, "",cp, dp - cp); + inform("invalid parameter in message %s's %s: " + "field\n%*sparameter %s (error detected at offset %d)", + filename, fieldname, strlen(invo_name) + 2, "",cp, dp - cp); return NOTOK; } @@ -3338,7 +3327,7 @@ parse_header_attrs (const char *filename, const char *fieldname, if (isdigit((unsigned char) *vp)) index = *vp - '0' + index * 10; else { - advise (NULL, "invalid parameter index in message %s's " + inform("invalid parameter index in message %s's " "%s: field\n%*s(parameter %s)", filename, fieldname, strlen(invo_name) + 2, "", cp); return NOTOK; @@ -3382,7 +3371,7 @@ parse_header_attrs (const char *filename, const char *fieldname, } vp++; } else { - advise(NULL, "missing charset in message %s's %s: " + inform("missing charset in message %s's %s: " "field\n%*s(parameter %s)", filename, fieldname, strlen(invo_name) + 2, "", nameptr); free(nameptr); @@ -3405,7 +3394,7 @@ parse_header_attrs (const char *filename, const char *fieldname, } vp++; } else { - advise(NULL, "missing language tag in message %s's %s: " + inform("missing language tag in message %s's %s: " "field\n%*s(parameter %s)", filename, fieldname, strlen(invo_name) + 2, "", nameptr); free(nameptr); @@ -3429,7 +3418,7 @@ parse_header_attrs (const char *filename, const char *fieldname, !isxdigit((unsigned char) *(vp + 1)) || *(vp + 2) == '\0' || !isxdigit((unsigned char) *(vp + 2))) { - advise(NULL, "invalid encoded sequence in message " + inform("invalid encoded sequence in message " "%s's %s: field\n%*s(parameter %s)", filename, fieldname, strlen(invo_name) + 2, "", nameptr); @@ -3472,11 +3461,9 @@ parse_header_attrs (const char *filename, const char *fieldname, switch (*cp++) { case '\0': bad_quote: - advise (NULL, - "invalid quoted-string in message %s's %s: " - "field\n%*s(parameter %s)", - filename, fieldname, strlen(invo_name) + 2, "", - nameptr); + inform("invalid quoted-string in message %s's %s: " + "field\n%*s(parameter %s)", filename, + fieldname, strlen(invo_name) + 2, "", nameptr); free(nameptr); mh_xfree(charset); mh_xfree(lang); @@ -3560,7 +3547,7 @@ bad_quote: } else { for (sp2 = pp->sechead; sp2 != NULL; sp2 = sp2->next) { if (sp2->index == sp->index) { - advise (NULL, "duplicate index (%d) in message " + inform("duplicate index (%d) in message " "%s's %s: field\n%*s(parameter %s)", sp->index, filename, fieldname, strlen(invo_name) + 2, "", nameptr); @@ -3575,7 +3562,7 @@ bad_quote: } if (sp2 == NULL) { - advise(NULL, "Internal error: cannot insert partial " + inform("Internal error: cannot insert partial " "param in message %s's %s: field\n%*s(parameter %s)", filename, fieldname, strlen(invo_name) + 2, "", nameptr); @@ -3618,7 +3605,7 @@ bad_quote: int pindex = 0; for (sp = pp->sechead; sp != NULL; sp = sp->next) { if (sp->index != pindex++) { - advise(NULL, "missing section %d for parameter in " + inform("missing section %d for parameter in " "message %s's %s: field\n%*s(parameter %s)", pindex - 1, filename, fieldname, strlen(invo_name) + 2, "", pp->name); @@ -3689,7 +3676,7 @@ output_params(size_t initialwidth, PM params, int *offsetout, int external) continue; if (strlen(params->pm_name) > CPERLIN) { - advise(NULL, "Parameter name \"%s\" is too long", params->pm_name); + inform("Parameter name \"%s\" is too long", params->pm_name); mh_xfree(paramout); return NULL; } @@ -3993,7 +3980,7 @@ encode_param(PM pm, char *output, size_t len, size_t valuelen, output += n; outlen += n; if (output > endptr) { - advise(NULL, "Internal error: parameter buffer overflow"); + inform("Internal error: parameter buffer overflow"); return 0; } } @@ -4013,7 +4000,7 @@ encode_param(PM pm, char *output, size_t len, size_t valuelen, outlen++; } if (output > endptr) { - advise(NULL, "Internal error: parameter buffer overflow"); + inform("Internal error: parameter buffer overflow"); return 0; } } @@ -4053,13 +4040,13 @@ normal_param(PM pm, char *output, size_t len, size_t valuelen, outlen++; } if (output > endptr) { - advise(NULL, "Internal error: parameter buffer overflow"); + inform("Internal error: parameter buffer overflow"); return 0; } } if (output - 2 > endptr) { - advise(NULL, "Internal error: parameter buffer overflow"); + inform("Internal error: parameter buffer overflow"); return 0; } diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 6b2efa88..3db2348f 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -435,7 +435,7 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer, char lastchar = '\n'; if (fd == NOTOK) { - advise(NULL, "Cannot use NULL command to display content-type " + inform("Cannot use NULL command to display content-type " "%s/%s", ct->c_ctinfo.ci_type, ct->c_ctinfo.ci_subtype); return NOTOK; } @@ -1085,7 +1085,7 @@ convert_charset (CT ct, char *dest_charset, int *message_mods) { if ((conv_desc = iconv_open (dest_charset, src_charset)) == (iconv_t) -1) { - advise (NULL, "Can't convert %s to %s", src_charset, dest_charset); + inform("Can't convert %s to %s", src_charset, dest_charset); free (src_charset); return NOTOK; } @@ -1158,7 +1158,7 @@ iconv_start: } fseeko (*fp, -inbytes, SEEK_CUR); if (end > 0) bytes_to_read += inbytes; - /* advise(NULL, "convert_charset: EINVAL"); */ + /* inform("convert_charset: EINVAL"); */ continue; } if (errno == EILSEQ) { @@ -1173,10 +1173,10 @@ iconv_start: ib++; inbytes--; /* skip it */ } (*ob++) = '?'; outbytes --; - /* advise(NULL, "convert_charset: EILSEQ"); */ + /* inform("convert_charset: EILSEQ"); */ goto iconv_start; } - advise (NULL, "convert_charset: errno = %d", errno); + inform("convert_charset: errno = %d", errno); status = NOTOK; break; } else { @@ -1246,7 +1246,7 @@ iconv_start: #else /* ! HAVE_ICONV */ NMH_UNUSED (message_mods); - advise (NULL, "Can't convert %s to %s without iconv", src_charset, + inform("Can't convert %s to %s without iconv", src_charset, dest_charset); errno = ENOSYS; status = NOTOK; diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 7604c210..ab8ab2e5 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -343,7 +343,7 @@ store_partial (CT ct, mhstoreinfo_t info) } if (hi == 0) { - advise (NULL, "missing (at least) last part of multipart message"); + inform("missing (at least) last part of multipart message"); return NOTOK; } @@ -375,9 +375,8 @@ store_partial (CT ct, mhstoreinfo_t info) } missing_part: - advise (NULL, - "missing %spart %d of %d part multipart message", - cur != hi ? "(at least) " : "", cur, hi); + inform("missing %spart %d of %d part multipart message", + cur != hi ? "(at least) " : "", cur, hi); goto losing; } else @@ -706,7 +705,7 @@ output_content_file (CT ct, int appending) int cc, fd; if (!ct->c_ceopenfnx) { - advise (NULL, "don't know how to decode part %s of message %s", + inform("don't know how to decode part %s of message %s", ct->c_partno, ct->c_file); return NOTOK; } @@ -905,7 +904,7 @@ output_content_folder (char *folder, char *filename) /* Link file into folder */ msgnum = folder_addmsg (&mp, filename, 0, 0, 0, 0, NULL); } else { - advise (NULL, "unable to read folder %s", folder); + inform("unable to read folder %s", folder); return NOTOK; } @@ -1175,7 +1174,7 @@ next_version (char *file, enum clobber_policy_t clobber_policy) { default: /* Should never get here. */ - advise (NULL, "will not overwrite %s, invalid clobber policy", buffer); + inform("will not overwrite %s, invalid clobber policy", buffer); free (buffer); return NULL; } @@ -1196,7 +1195,7 @@ next_version (char *file, enum clobber_policy_t clobber_policy) { free (file); if (version >= max_versions) { - advise (NULL, "will not overwrite %s, too many versions", buffer); + inform("will not overwrite %s, too many versions", buffer); free (buffer); buffer = NULL; } @@ -1278,7 +1277,7 @@ clobber_check (char *original_file, mhstoreinfo_t info) { free (prompt); } else { /* Overwrite, that's what nmh used to do. And warn. */ - advise (NULL, "-clobber ask but no tty, so overwrite %s", file); + inform("-clobber ask but no tty, so overwrite %s", file); break; } @@ -1322,7 +1321,7 @@ clobber_check (char *original_file, mhstoreinfo_t info) { if (stat (file, &st) == OK) { /* Keep count of files that would have been clobbered, and return that as process exit status. */ - advise (NULL, "will not overwrite %s with -clobber never", file); + inform("will not overwrite %s with -clobber never", file); free (file); file = NULL; ++info->files_not_clobbered; diff --git a/uip/mkstemp.c b/uip/mkstemp.c index f4215c08..6933a3fd 100644 --- a/uip/mkstemp.c +++ b/uip/mkstemp.c @@ -164,7 +164,7 @@ process_args(int argc, char **argv, const char **directory, ambigsw(cp, switches); done(NOTOK); case UNKWNSW: - advise (NULL, "-%s unknown", cp); + inform("-%s unknown", cp); (void) snprintf(buf, sizeof buf, "%s [switches]", invo_name); print_help(buf, switches, 1); done(NOTOK); diff --git a/uip/msgchk.c b/uip/msgchk.c index eed61cd2..af25b1e3 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -265,7 +265,7 @@ main (int argc, char **argv) if ((pw = getpwnam (vec[vecp]))) status += checkmail (pw->pw_name, pw->pw_dir, datesw, notifysw, 0); else - advise (NULL, "no such user as %s", vec[vecp]); + inform("no such user as %s", vec[vecp]); } } } /* host == NULL */ @@ -389,7 +389,7 @@ remotemail (char *host, char *port, char *user, char *proxy, int notifysw, auth_svc) == NOTOK || pop_stat (&nmsgs, &nbytes) == NOTOK /* check for messages */ || pop_quit () == NOTOK) { /* quit POP connection */ - advise (NULL, "%s", response); + inform("%s", response); return 1; } diff --git a/uip/picksbr.c b/uip/picksbr.c index 6faa108f..c8444e0a 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -115,7 +115,7 @@ static unsigned char cc[] = { #define nxtarg() (*argp ? *argp++ : NULL) #define prvarg() argp-- -#define padvise if (!talked++) advise +#define pinform if (!talked++) inform struct nexus { int (*n_action)(); @@ -203,7 +203,7 @@ pcompile (char **vec, char *date) return (talked ? 0 : 1); if (*argp) { - padvise (NULL, "%s unexpected", *argp); + inform("%s unexpected", *argp); return 0; } @@ -221,7 +221,7 @@ parse (void) return n; if (*cp != '-') { - padvise (NULL, "%s unexpected", cp); + pinform("%s unexpected", cp); return NULL; } @@ -242,7 +242,7 @@ parse (void) o->n_L_child = n; if ((o->n_R_child = parse ())) return o; - padvise (NULL, "missing disjunctive"); + pinform("missing disjunctive"); free (o); return NULL; @@ -263,7 +263,7 @@ nexp1 (void) return n; if (*cp != '-') { - padvise (NULL, "%s unexpected", cp); + pinform("%s unexpected", cp); free (n); return NULL; } @@ -287,7 +287,7 @@ nexp1 (void) o->n_L_child = n; if ((o->n_R_child = nexp1 ())) return o; - padvise (NULL, "missing conjunctive"); + pinform("missing conjunctive"); free (o); return NULL; @@ -329,7 +329,7 @@ nexp2 (void) n = newnexus (NOTaction); if ((n->n_L_child = nexp3 ())) return n; - padvise (NULL, "missing negation"); + pinform("missing negation"); free (n); return NULL; @@ -352,7 +352,7 @@ nexp3 (void) return NULL; if (*cp != '-') { - padvise (NULL, "%s unexpected", cp); + pinform("%s unexpected", cp); return NULL; } @@ -372,16 +372,16 @@ nexp3 (void) case PRLBR: if ((n = parse ()) == NULL) { - padvise (NULL, "missing group"); + pinform("missing group"); return NULL; } if ((cp = nxtarg ()) == NULL) { - padvise (NULL, "missing -rbrace"); + pinform("missing -rbrace"); return NULL; } if (*cp++ == '-' && smatch (cp, parswit) == PRRBR) return n; - padvise (NULL, "%s unexpected", --cp); + pinform("%s unexpected", --cp); return NULL; default: @@ -398,7 +398,7 @@ nexp3 (void) dp = *brkstring (temp, " ", NULL); header: ; if (!(cp = nxtarg ())) {/* allow -xyz arguments */ - padvise (NULL, "missing argument to %s", argp[-2]); + pinform("missing argument to %s", argp[-2]); return NULL; } n = newnexus (GREPaction); @@ -411,14 +411,14 @@ nexp3 (void) n = newnexus (GREPaction); n->n_header = 0; if (!(cp = nxtarg ())) {/* allow -xyz arguments */ - padvise (NULL, "missing argument to %s", argp[-2]); + pinform("missing argument to %s", argp[-2]); free (n); return NULL; } dp = cp; pattern: ; if (!gcompile (n, dp)) { - padvise (NULL, "pattern error in %s %s", argp[-2], cp); + pinform("pattern error in %s %s", argp[-2], cp); free (n); return NULL; } @@ -426,12 +426,12 @@ nexp3 (void) return n; case PROTHR: - padvise (NULL, "internal error!"); + pinform("internal error!"); return NULL; case PRDATF: if (!(datesw = nxtarg ()) || *datesw == '-') { - padvise (NULL, "missing argument to %s", argp[-2]); + pinform("missing argument to %s", argp[-2]); return NULL; } return nexp3 (); @@ -439,13 +439,13 @@ nexp3 (void) case PRAFTR: case PRBEFR: if (!(cp = nxtarg ())) {/* allow -xyz arguments */ - padvise (NULL, "missing argument to %s", argp[-2]); + pinform("missing argument to %s", argp[-2]); return NULL; } n = newnexus (TWSaction); n->n_datef = datesw; if (!tcompile (cp, &n->n_tws, n->n_after = i == PRAFTR)) { - padvise (NULL, "unable to parse %s %s", argp[-2], cp); + pinform("unable to parse %s %s", argp[-2], cp); free (n); return NULL; } @@ -962,7 +962,7 @@ plist case LENERR: case FMTERR: if (state == LENERR || state == FMTERR) - advise (NULL, "format error in message %d", msgnum); + inform("format error in message %d", msgnum); mh_xfree(bp); return 0; @@ -974,7 +974,7 @@ plist m_getfld_state_destroy (&gstate); if ((tw = dparsetime (bp)) == NULL) - advise (NULL, "unable to parse %s field in message %d, matching...", + inform("unable to parse %s field in message %d, matching...", n->n_datef, msgnum), state = 1; else state = n->n_after ? (twsort (tw, &n->n_tws) > 0) diff --git a/uip/post.c b/uip/post.c index 9973beb7..7cc111e4 100644 --- a/uip/post.c +++ b/uip/post.c @@ -796,7 +796,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) str++; if (msgstate == NORMAL && uprf (name, "resent")) { - advise (NULL, "illegal header line -- %s:", name); + inform("illegal header line -- %s:", name); badmsg++; return; } @@ -827,7 +827,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) if (strcmp (str, "\n")) { trim_suffix_c(str, '\n'); if (! whomsw) { - advise (NULL, "ignoring header line -- %s: %s", name, str); + inform("ignoring header line -- %s: %s", name, str); } } } @@ -840,7 +840,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) return; } if (hdr->flags & HBAD) { - advise (NULL, "illegal header line -- %s:", name); + inform("illegal header line -- %s:", name); badmsg++; return; } @@ -900,11 +900,11 @@ putfmt (char *name, char *str, int *eai, FILE *out) */ if ((msgstate == RESENT) ? (hdr->set & MRSN) : (hdr->set & MSND)) { - advise (NULL, "%s: field requires one address", name); + inform("%s: field requires one address", name); badmsg++; } #ifdef notdef - advise (NULL, "%s: field requires at least one address", name); + inform("%s: field requires at least one address", name); badmsg++; #endif /* notdef */ } @@ -912,7 +912,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) } if (count > 1 && (hdr->flags & HONE)) { - advise (NULL, "%s: field only permits one address", name); + inform("%s: field only permits one address", name); badmsg++; return; } @@ -1068,7 +1068,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) } if (grp > 0 && (hdr->flags & HNGR)) { - advise (NULL, "%s: field does not allow groups", name); + inform("%s: field does not allow groups", name); badmsg++; } if (linepos) { @@ -1108,14 +1108,14 @@ finish_headers (FILE *out) /* * A From: header is now required in the draft. */ - advise (NULL, "message has no From: header"); - advise (NULL, "See default components files for examples"); + inform("message has no From: header"); + inform("See default components files for examples"); badmsg++; break; } if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) { - advise (NULL, "A Sender: or Envelope-From: header is required " + inform("A Sender: or Envelope-From: header is required " "with multiple\nFrom: addresses"); badmsg++; break; @@ -1135,7 +1135,7 @@ finish_headers (FILE *out) if (fromcount > 1 && seensender == 0) { if (efrom[0] == '\0') { - advise (NULL, "Envelope-From cannot be blank when there " + inform("Envelope-From cannot be blank when there " "is multiple From: addresses\nand no Sender: " "header"); badmsg++; @@ -1150,21 +1150,21 @@ finish_headers (FILE *out) case RESENT: if (!(msgflags & MDAT)) { - advise (NULL, "message has no Date: header"); + inform("message has no Date: header"); badmsg++; } if (!(msgflags & MFRM)) { - advise (NULL, "message has no From: header"); + inform("message has no From: header"); badmsg++; } if (!(msgflags & MRFM)) { - advise (NULL, "message has no Resent-From: header"); - advise (NULL, "See default components files for examples"); + inform("message has no Resent-From: header"); + inform("See default components files for examples"); badmsg++; break; } if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) { - advise (NULL, "A Resent-Sender: or Envelope-From: header is " + inform("A Resent-Sender: or Envelope-From: header is " "required with multiple\nResent-From: addresses"); badmsg++; break; @@ -1185,7 +1185,7 @@ finish_headers (FILE *out) if (fromcount > 1 && seensender == 0) { if (efrom[0] == '\0') { - advise (NULL, "Envelope-From cannot be blank when there " + inform("Envelope-From cannot be blank when there " "is multiple Resent-From: addresses and no " "Resent-Sender: header"); badmsg++; diff --git a/uip/rcvstore.c b/uip/rcvstore.c index 25bb8780..f3ee787f 100644 --- a/uip/rcvstore.c +++ b/uip/rcvstore.c @@ -175,7 +175,7 @@ main (int argc, char **argv) /* don't add file if it is empty */ if (st.st_size == 0) { (void) m_unlink (tmpfilenam); - advise (NULL, "empty file"); + inform("empty file"); done (0); } diff --git a/uip/rcvtty.c b/uip/rcvtty.c index 291cb69c..c38dd061 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -189,7 +189,7 @@ message_fd (char **vec) struct stat st; if ((tfile = m_mktemp2(NULL, invo_name, &fd, NULL)) == NULL) { - advise(NULL, "unable to create temporary file in %s", get_temp_dir()); + inform("unable to create temporary file in %s", get_temp_dir()); return NOTOK; } (void) m_unlink(tfile); /* Use fd, no longer need the file name. */ @@ -255,7 +255,7 @@ header_fd (void) charstring_t scanl = NULL; if ((tfile = m_mktemp2(NULL, invo_name, &fd, NULL)) == NULL) { - advise(NULL, "unable to create temporary file in %s", get_temp_dir()); + inform("unable to create temporary file in %s", get_temp_dir()); return NOTOK; } (void) m_unlink(tfile); /* Use fd, no longer need the file name. */ diff --git a/uip/repl.c b/uip/repl.c index 15aa0a3a..430e2cc3 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -389,7 +389,7 @@ try_it_again: i = YESW; break; default: - advise (NULL, "say what?"); + inform("say what?"); break; } } diff --git a/uip/rmf.c b/uip/rmf.c index 6a86fe6a..ebe88fed 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -143,7 +143,7 @@ rmf (char *folder) printf ("[+%s de-referenced]\n", folder); return OK; } - advise (NULL, "you have no profile entry for the %s folder +%s", + inform("you have no profile entry for the %s folder +%s", i == NOTOK ? "unreadable" : "read-only", folder); return NOTOK; } @@ -201,7 +201,7 @@ rmf (char *folder) if (others == 0 && remdir (maildir)) return OK; - advise (NULL, "folder +%s not removed", folder); + inform("folder +%s not removed", folder); return NOTOK; } diff --git a/uip/scan.c b/uip/scan.c index e971f553..eb9e8fc2 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -266,7 +266,7 @@ main (int argc, char **argv) adios (NULL, "scan() botch (%d)", state); case SCNEOF: - advise (NULL, "message %d: empty", msgnum); + inform("message %d: empty", msgnum); break; } charstring_free (scanl); diff --git a/uip/send.c b/uip/send.c index da7532a7..de94af2d 100644 --- a/uip/send.c +++ b/uip/send.c @@ -302,14 +302,14 @@ main (int argc, char **argv) continue; case ATTACHSW: - advise(NULL, "The -attach switch is deprecated"); + inform("The -attach switch is deprecated"); continue; case NOATTACHSW: - advise(NULL, "The -noattach switch is deprecated"); + inform("The -noattach switch is deprecated"); continue; case ATTACHFORMATSW: - advise(NULL, "The -attachformat switch is deprecated"); + inform("The -attachformat switch is deprecated"); continue; } } else { @@ -347,7 +347,7 @@ main (int argc, char **argv) showfile (++argp, msgs[0]); break; default: - advise (NULL, "say what?"); + inform("say what?"); break; } } diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 6409aeca..1acb7dc0 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -484,7 +484,7 @@ sendaux (char **vec, int vecp, char *program, char *drft, struct stat *st) alert (drft, fd); close (fd); } else { - advise (NULL, "message not delivered to anyone"); + inform("message not delivered to anyone"); } if (annotext && fd2 != NOTOK) close (fd2); @@ -587,7 +587,7 @@ tmp_fd (void) if ((tfile = m_mktemp2(NULL, invo_name, &fd, NULL)) == NULL) return NOTOK; if (debugsw) - advise (NULL, "temporary file %s selected", tfile); + inform("temporary file %s selected", tfile); else if (m_unlink (tfile) == NOTOK) advise (tfile, "unable to remove"); @@ -618,8 +618,7 @@ anno (int fd, struct stat *st) switch (child_id) { case NOTOK: /* oops */ if (!debugsw) - advise (NULL, - "unable to fork, so doing annotations by hand..."); + inform("unable to fork, so doing annotations by hand..."); if (cwd == NULL) cwd = mh_xstrdup(pwd ()); /* FALLTHRU */ @@ -724,12 +723,12 @@ annoaux (int fd) fclose (fp); if (debugsw) - advise (NULL, "annotate%s with %s: \"%s\"", + inform("annotate%s with %s: \"%s\"", inplace ? " inplace" : "", annotext, cp); for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { if (debugsw) - advise (NULL, "annotate message %d", msgnum); + inform("annotate message %d", msgnum); annotate (m_name (msgnum), annotext, cp, inplace, 1, -2, 0); } } diff --git a/uip/slocal.c b/uip/slocal.c index f41b6ad3..1751add6 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -782,11 +782,11 @@ parse (int fd) case LENERR: case FMTERR: - advise (NULL, "format error in message"); + inform("format error in message"); break; default: - advise (NULL, "internal error in m_getfld"); + inform("internal error in m_getfld"); fclose (in); return -1; } diff --git a/uip/sortm.c b/uip/sortm.c index 97d42e5f..bd223bc3 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -413,10 +413,8 @@ get_fields (char *datesw, int msg, struct smsg *smsg) if (!datecomp || (tw = dparsetime (datecomp)) == NULL) { struct stat st; - advise (NULL, - "can't parse %s field in message %d, " - "will use file modification time", - datesw, msg); + inform("can't parse %s field in message %d, " + "will use file modification time", datesw, msg); fstat (fileno (in), &st); smsg->s_clock = st.st_mtime; check_failed = 1; diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 61cf45d6..e2e0ceb6 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -199,11 +199,11 @@ WhatNow (int argc, char **argv) continue; case ATTACHSW: - advise(NULL, "The -attach switch is deprecated"); + inform("The -attach switch is deprecated"); continue; case NOATTACHSW: - advise(NULL, "The -noattach switch is deprecated"); + inform("The -noattach switch is deprecated"); continue; } } @@ -250,7 +250,7 @@ WhatNow (int argc, char **argv) if (msgnam) showfile (++argp, msgnam); else - advise (NULL, "no alternate message to display"); + inform("no alternate message to display"); break; case BUILDMIMESW: @@ -284,7 +284,7 @@ WhatNow (int argc, char **argv) removefile (drft); } else { if (stat (drft, &st) != NOTOK) - advise (NULL, "draft left on %s", drft); + inform("draft left on %s", drft); } done (1); @@ -385,7 +385,7 @@ WhatNow (int argc, char **argv) } if (n == -1) - advise(NULL, "usage is alist [-ln]."); + inform("usage is alist [-ln]."); else annolist(drft, ATTACH_FIELD, l, n); @@ -413,7 +413,7 @@ WhatNow (int argc, char **argv) } if (*(argp+1) == NULL) { - advise(NULL, "attach command requires file argument(s)."); + inform("attach command requires file argument(s)."); break; } @@ -532,7 +532,7 @@ WhatNow (int argc, char **argv) default: /* Unknown command */ - advise (NULL, "say what?"); + inform("say what?"); break; } } @@ -741,9 +741,9 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, && (!reedit || (status & 0x00ff))) { if (!use && (status & 0xff00) && (rename (file, cp = m_backup (file)) != NOTOK)) { - advise (NULL, "problems with edit--draft left in %s", cp); + inform("problems with edit--draft left in %s", cp); } else { - advise (NULL, "problems with edit--%s preserved", file); + inform("problems with edit--%s preserved", file); } } status = -2; /* maybe "reedit ? -2 : -1"? */ @@ -833,7 +833,7 @@ sendfile (char **arg, char *file, int pushsw) sleep (5); switch (child_id) { case NOTOK: - advise (NULL, "unable to fork, so sending directly..."); + inform("unable to fork, so sending directly..."); /* FALLTHRU */ case OK: vec = argsplit(sendproc, &program, &vecp); @@ -1072,7 +1072,7 @@ sendit (char *sp, char **arg, char *file, int pushed) ambigsw (cp, sendswitches); return; case UNKWNSW: - advise (NULL, "-%s unknown\n", cp); + inform("-%s unknown\n", cp); return; case SHELPSW: @@ -1092,7 +1092,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case SPLITSW: if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1) { - advise (NULL, "missing argument to %s", argp[-2]); + inform("missing argument to %s", argp[-2]); return; } continue; @@ -1174,7 +1174,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case MESSAGEIDSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') { - advise (NULL, "missing argument to %s", argp[-2]); + inform("missing argument to %s", argp[-2]); return; } vec[vecp++] = cp; @@ -1184,7 +1184,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case SDRFSW: case SDRMSW: if (!(cp = *argp++) || *cp == '-') { - advise (NULL, "missing argument to %s", argp[-2]); + inform("missing argument to %s", argp[-2]); return; } /* FALLTHRU */ @@ -1192,18 +1192,18 @@ sendit (char *sp, char **arg, char *file, int pushed) continue; case SNDATTACHSW: - advise(NULL, "The -attach switch is deprecated"); + inform("The -attach switch is deprecated"); continue; case SNDNOATTACHSW: - advise(NULL, "The -noattach switch is deprecated"); + inform("The -noattach switch is deprecated"); continue; case SNDATTACHFORMAT: - advise(NULL, "The -attachformat switch is deprecated"); + inform("The -attachformat switch is deprecated"); continue; } } - advise (NULL, "usage: %s [switches]", sp); + inform("usage: %s [switches]", sp); return; } @@ -1351,7 +1351,7 @@ checkmimeheader (char *drft) case FLD: case FLDPLUS: if (strcasecmp(name, VRSN_FIELD) == 0) { - advise(NULL, "Cannot use attach commands with already-" + inform("Cannot use attach commands with already-" "formatted MIME message \"%s\"", drft); retval = 1; break; diff --git a/uip/whom.c b/uip/whom.c index 4a3f81dc..d1feb9fe 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -182,7 +182,7 @@ main (int argc, char **argv) switch (distsw ? child_id : OK) { case NOTOK: - advise (NULL, "unable to fork, so checking directly..."); + inform("unable to fork, so checking directly..."); /* FALLTHRU */ case OK: execvp (postproc, vec);