]> diplodocus.org Git - nmh/blobdiff - uip/msgchk.c
Added context_find_prefix().
[nmh] / uip / msgchk.c
index af280f595bc92a49ecb39812c95409f8b291d3f0..49e758f07be9aa4c37a1dca644df06b624ed4324 100644 (file)
@@ -85,13 +85,7 @@ main (int argc, char **argv)
     char **argp, **arguments, *vec[MAXVEC];
     struct passwd *pw;
 
-#ifdef LOCALE
-    setlocale(LC_ALL, "");
-#endif
-    invo_name = r1bindex (argv[0], '/');
-
-    /* read user profile/context */
-    context_read();
+    if (nmh_init(argv[0], 1)) { return 1; }
 
     mts_init (invo_name);
 
@@ -285,7 +279,10 @@ checkmail (char *user, char *home, int datesw, int notifysw, int personal)
 
     if ((mf & UUCPOK) || (mf & MMDFOK)) {
        if (notifysw & NT_MAIL) {
-           printf (personal ? "You have " : "%s has ", user);
+           if (personal)
+               printf ("You have ");
+           else
+               printf ("%s has ", user);
            if (mf & UUCPOK)
                printf ("%s old-style bell", mf & UUCPOLD ? "old" : "new");
            if ((mf & UUCPOK) && (mf & MMDFOK))
@@ -340,7 +337,11 @@ remotemail (char *host, char *port, char *user, char *proxy, int notifysw,
 
     if (nmsgs) {
        if (notifysw & NT_MAIL) {
-           printf (personal ? "You have " : "%s has ", user);
+           if (personal)
+               printf ("You have ");
+           else
+               printf ("%s has ", user);
+
            printf ("%d message%s (%d bytes)",
                    nmsgs, nmsgs != 1 ? "s" : "", nbytes);
        }