summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-03-12 23:49:29 +0000
committerJim Meyering <jim@meyering.net>1996-03-12 23:49:29 +0000
commit6fc4ae7a28f4603daee61672949835aa6e6059ff (patch)
treea4513c47f111bc79c4fc75875664350b2b951536 /src
parent3f92a4421a7bba073bf58b5f6b85d59055a7766f (diff)
downloadcoreutils-6fc4ae7a28f4603daee61672949835aa6e6059ff.tar.xz
(main): Initialize for internationalized message support:
call setlocale, bindtextdomain, and textdomain.
Diffstat (limited to 'src')
-rw-r--r--src/basename.c3
-rw-r--r--src/date.c3
-rw-r--r--src/dirname.c3
-rw-r--r--src/echo.c3
-rw-r--r--src/env.c3
-rw-r--r--src/expr.c3
-rw-r--r--src/factor.c3
-rw-r--r--src/hostname.c7
-rw-r--r--src/id.c3
-rw-r--r--src/logname.c3
-rw-r--r--src/nice.c4
-rw-r--r--src/pathchk.c3
-rw-r--r--src/printenv.c3
-rw-r--r--src/printf.c4
-rw-r--r--src/pwd.c3
-rw-r--r--src/seq.c4
-rw-r--r--src/sleep.c3
-rw-r--r--src/stty.c3
-rw-r--r--src/su.c4
-rw-r--r--src/tee.c4
-rw-r--r--src/test.c3
-rw-r--r--src/tty.c4
-rw-r--r--src/uname.c4
-rw-r--r--src/who-users.c3
-rw-r--r--src/whoami.c3
-rw-r--r--src/yes.c3
26 files changed, 87 insertions, 2 deletions
diff --git a/src/basename.c b/src/basename.c
index ad2dcdad7..6d2ea21f1 100644
--- a/src/basename.c
+++ b/src/basename.c
@@ -72,6 +72,9 @@ main (int argc, char **argv)
char *name;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "basename", version_string, usage);
diff --git a/src/date.c b/src/date.c
index 744900e77..7b0c456c3 100644
--- a/src/date.c
+++ b/src/date.c
@@ -159,6 +159,9 @@ main (int argc, char **argv)
int option_specified_date;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((optc = getopt_long (argc, argv, "d:f:r:Rs:u", long_options, NULL))
!= EOF)
diff --git a/src/dirname.c b/src/dirname.c
index 52ef010e5..82eca2229 100644
--- a/src/dirname.c
+++ b/src/dirname.c
@@ -62,6 +62,9 @@ main (int argc, char **argv)
register char *slash;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "dirname", version_string, usage);
diff --git a/src/echo.c b/src/echo.c
index 9a72b553a..3f31a444b 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -107,6 +107,9 @@ main (int argc, char **argv)
int display_return = 1, do_v9 = 0;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "echo", version_string, usage);
diff --git a/src/env.c b/src/env.c
index 0711de8c3..24ad743de 100644
--- a/src/env.c
+++ b/src/env.c
@@ -119,6 +119,9 @@ main (register int argc, register char **argv, char **envp)
int ignore_environment = 0;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((optc = getopt_long (argc, argv, "+iu:", longopts, (int *) 0)) != EOF)
{
diff --git a/src/expr.c b/src/expr.c
index f6e13aa21..3376a6dfd 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -155,6 +155,9 @@ main (int argc, char **argv)
VALUE *v;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "expr", version_string, usage);
diff --git a/src/factor.c b/src/factor.c
index 816b26688..11251244c 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -174,6 +174,9 @@ main (int argc, char **argv)
int fail;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "factor", version_string, usage);
diff --git a/src/hostname.c b/src/hostname.c
index fff5954c0..239dba08c 100644
--- a/src/hostname.c
+++ b/src/hostname.c
@@ -38,9 +38,9 @@ sethostname (name, namelen)
{
/* Using sysinfo() is the SVR4 mechanism to set a hostname. */
int result;
-
+
result = sysinfo (SI_SET_HOSTNAME, name, namelen);
-
+
return (result == -1 ? result : 0);
}
@@ -79,6 +79,9 @@ main (int argc, char **argv)
char *hostname;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "hostname", version_string, usage);
diff --git a/src/id.c b/src/id.c
index 5864415d8..a03ba6e68 100644
--- a/src/id.c
+++ b/src/id.c
@@ -101,6 +101,9 @@ main (int argc, char **argv)
int optc;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((optc = getopt_long (argc, argv, "gnruG", longopts, (int *) 0))
!= EOF)
diff --git a/src/logname.c b/src/logname.c
index 9a0b0ec48..9d71c751e 100644
--- a/src/logname.c
+++ b/src/logname.c
@@ -65,6 +65,9 @@ main (int argc, char **argv)
int c;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF)
{
diff --git a/src/nice.c b/src/nice.c
index 61d4d87a8..579a206be 100644
--- a/src/nice.c
+++ b/src/nice.c
@@ -64,6 +64,10 @@ main (int argc, char **argv)
int last_optind = 0;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
parse_long_options (argc, argv, "nice", version_string, usage);
for (optind = 1; optind < argc; /* empty */)
diff --git a/src/pathchk.c b/src/pathchk.c
index 3aaa09968..ad5daddf6 100644
--- a/src/pathchk.c
+++ b/src/pathchk.c
@@ -121,6 +121,9 @@ main (int argc, char **argv)
int optc;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((optc = getopt_long (argc, argv, "p", longopts, (int *) 0)) != EOF)
{
diff --git a/src/printenv.c b/src/printenv.c
index 9e13aa3fe..6bc45c1fa 100644
--- a/src/printenv.c
+++ b/src/printenv.c
@@ -83,6 +83,9 @@ main (int argc, char **argv)
int exit_status;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF)
{
diff --git a/src/printf.c b/src/printf.c
index 35eb19319..7c5f338a9 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -132,6 +132,10 @@ main (int argc, char **argv)
int args_used;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
exit_status = 0;
parse_long_options (argc, argv, "printf", version_string, usage);
diff --git a/src/pwd.c b/src/pwd.c
index ff9f6d93a..c61c19438 100644
--- a/src/pwd.c
+++ b/src/pwd.c
@@ -56,6 +56,9 @@ main (int argc, char **argv)
char *wd;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "pwd", version_string, usage);
diff --git a/src/seq.c b/src/seq.c
index dae55db97..cdfcd6da3 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -103,6 +103,10 @@ main (int argc, char **argv)
int step_is_set;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
equal_width = 0;
format_str = NULL;
separator = "\n";
diff --git a/src/sleep.c b/src/sleep.c
index dcf4db65e..b37e94393 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -69,6 +69,9 @@ main (int argc, char **argv)
int c;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF)
{
diff --git a/src/stty.c b/src/stty.c
index 72a6f1afe..e18e34bb3 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -650,6 +650,9 @@ main (int argc, char **argv)
int k;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "stty", version_string, usage);
diff --git a/src/su.c b/src/su.c
index 44cacbb3e..25168fc14 100644
--- a/src/su.c
+++ b/src/su.c
@@ -195,6 +195,10 @@ main (argc, argv)
struct passwd pw_copy;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
fast_startup = 0;
simulate_login = 0;
change_environment = 1;
diff --git a/src/tee.c b/src/tee.c
index 34dc614c8..95018ddb7 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -84,6 +84,10 @@ main (int argc, char **argv)
int optc;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
append = 0;
ignore_interrupts = 0;
diff --git a/src/test.c b/src/test.c
index 512ccfb5e..face6a5b2 100644
--- a/src/test.c
+++ b/src/test.c
@@ -1065,6 +1065,9 @@ main (int margc, char **margv)
return (test_error_return);
#else /* TEST_STANDALONE */
program_name = margv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
#endif /* TEST_STANDALONE */
argv = margv;
diff --git a/src/tty.c b/src/tty.c
index 598606339..26c293bb7 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -61,6 +61,10 @@ main (int argc, char **argv)
int optc;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
silent = 0;
while ((optc = getopt_long (argc, argv, "s", longopts, (int *) 0)) != EOF)
diff --git a/src/uname.c b/src/uname.c
index ca1caa0c4..e64af98ed 100644
--- a/src/uname.c
+++ b/src/uname.c
@@ -88,6 +88,10 @@ main (int argc, char **argv)
int c;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
toprint = 0;
while ((c = getopt_long (argc, argv, "snrvma", long_options, (int *) 0))
diff --git a/src/who-users.c b/src/who-users.c
index 4518e152d..4cc9206ab 100644
--- a/src/who-users.c
+++ b/src/who-users.c
@@ -573,6 +573,9 @@ main (int argc, char **argv)
#endif /* WHO */
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
#ifdef WHO
while ((optc = getopt_long (argc, argv, "imqsuwHT", longopts, &longind))
diff --git a/src/whoami.c b/src/whoami.c
index 66293d849..0bd3cddde 100644
--- a/src/whoami.c
+++ b/src/whoami.c
@@ -70,6 +70,9 @@ main (int argc, char **argv)
int c;
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF)
{
diff --git a/src/yes.c b/src/yes.c
index 2b78ea51c..58a06d6a6 100644
--- a/src/yes.c
+++ b/src/yes.c
@@ -50,6 +50,9 @@ void
main (int argc, char **argv)
{
program_name = argv[0];
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
parse_long_options (argc, argv, "yes", version_string, usage);