]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - login-utils/mesg.c
Imported from util-linux-2.11o tarball.
[thirdparty/util-linux.git] / login-utils / mesg.c
index d05d333c96caf303e537b0909b4923bde061ee8d..a94ef6650c4cd3ffede91354e3349c6f881241ae 100644 (file)
  * Modified Fri Mar 10 20:27:19 1995, faith@cs.unc.edu, for Linux
  * Modified Mon Jul  1 18:14:10 1996, janl@ifi.uio.no, writing to stdout
  *     as suggested by Michael Meskes <meskes@Informatik.RWTH-Aachen.DE>
+ *
+ * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ * - added Native Language Support
+ *
  * 
  */
 
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <err.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include "errs.h"
+#include "nls.h"
 
 int
 main(argc, argv)
@@ -60,7 +65,12 @@ main(argc, argv)
        char *tty;
        int ch;
 
-       while ((ch = getopt(argc, argv, "")) != EOF)
+       setlocale(LC_ALL, "");
+       bindtextdomain(PACKAGE, LOCALEDIR);
+       textdomain(PACKAGE);
+
+
+       while ((ch = getopt(argc, argv, "")) != -1)
                switch (ch) {
                case '?':
                default:
@@ -76,10 +86,10 @@ main(argc, argv)
 
        if (*argv == NULL) {
                if (sb.st_mode & (S_IWGRP | S_IWOTH)) {
-                       (void)fprintf(stdout, "is y\n");
+                       (void)fprintf(stdout, _("is y\n"));
                        exit(0);
                }
-               (void)fprintf(stdout, "is n\n");
+               (void)fprintf(stdout, _("is n\n"));
                exit(1);
        }
 
@@ -99,6 +109,6 @@ main(argc, argv)
                exit(1);
        }
 
-usage: (void)fprintf(stderr, "usage: mesg [y | n]\n");
+usage: (void)fprintf(stderr, _("usage: mesg [y | n]\n"));
        exit(2);
 }