From 715765a5487d2e37c4d48e216e6958883db6a41f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 9 Mar 1996 20:19:13 +0000 Subject: (main): Initialize for internationalized message support: call setlocale, bindtextdomain, and textdomain. --- src/cat.c | 3 +++ src/cksum.c | 4 ++++ src/comm.c | 3 +++ src/csplit.c | 10 +++++++--- src/cut.c | 3 +++ src/expand.c | 3 +++ src/fmt.c | 3 +++ src/fold.c | 4 ++++ src/head.c | 4 ++++ src/join.c | 3 +++ src/md5sum.c | 3 +++ src/nl.c | 4 ++++ src/od.c | 4 ++++ src/paste.c | 4 ++++ src/pr.c | 3 +++ src/sort.c | 3 +++ src/split.c | 3 +++ src/sum.c | 4 ++++ src/tac.c | 4 ++++ src/tail.c | 4 ++++ src/tr.c | 3 +++ src/unexpand.c | 6 +++++- src/uniq.c | 4 ++++ src/wc.c | 4 ++++ 24 files changed, 89 insertions(+), 4 deletions(-) diff --git a/src/cat.c b/src/cat.c index d09be30de..31eada9d7 100644 --- a/src/cat.c +++ b/src/cat.c @@ -505,6 +505,9 @@ main (int argc, char **argv) }; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); /* Parse command line options. */ diff --git a/src/cksum.c b/src/cksum.c index c5c8c020e..c3f3a8119 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -287,6 +287,10 @@ main (int argc, char **argv) int errors = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + have_read_stdin = 0; while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF) diff --git a/src/comm.c b/src/comm.c index 8ecfa7a9b..e9db88874 100644 --- a/src/comm.c +++ b/src/comm.c @@ -218,6 +218,9 @@ main (int argc, char **argv) int c; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); only_file_1 = 1; only_file_2 = 1; diff --git a/src/csplit.c b/src/csplit.c index b89a36925..508eadc77 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -1404,9 +1404,13 @@ main (int argc, char **argv) unsigned long val; #ifdef SA_INTERRUPT struct sigaction oldact, newact; -#endif /* SA_INTERRUPT */ +#endif program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + global_argv = argv; controls = NULL; control_used = 0; @@ -1434,7 +1438,7 @@ main (int argc, char **argv) sigaction (SIGTERM, NULL, &oldact); if (oldact.sa_handler != SIG_IGN) sigaction (SIGTERM, &newact, NULL); -#else +#else /* not SA_INTERRUPT */ if (signal (SIGHUP, SIG_IGN) != SIG_IGN) signal (SIGHUP, interrupt_handler); if (signal (SIGINT, SIG_IGN) != SIG_IGN) @@ -1443,7 +1447,7 @@ main (int argc, char **argv) signal (SIGQUIT, interrupt_handler); if (signal (SIGTERM, SIG_IGN) != SIG_IGN) signal (SIGTERM, interrupt_handler); -#endif +#endif /* not SA_INTERRUPT */ while ((optc = getopt_long (argc, argv, "f:b:kn:sqz", longopts, (int *) 0)) != EOF) diff --git a/src/cut.c b/src/cut.c index a4ee26ac9..d50ec71c9 100644 --- a/src/cut.c +++ b/src/cut.c @@ -676,6 +676,9 @@ main (int argc, char **argv) int optc, exit_status = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); operating_mode = undefined_mode; diff --git a/src/expand.c b/src/expand.c index f4939c771..93ddee476 100644 --- a/src/expand.c +++ b/src/expand.c @@ -334,6 +334,9 @@ main (int argc, char **argv) tab_list = NULL; first_free_tab = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((c = getopt_long (argc, argv, "it:,0123456789", longopts, (int *) 0)) != EOF) diff --git a/src/fmt.c b/src/fmt.c index 89b5e77f9..faf975bc7 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -327,6 +327,9 @@ main (register int argc, register char **argv) FILE *infile; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); crown = tagged = split = uniform = FALSE; max_width = WIDTH; diff --git a/src/fold.c b/src/fold.c index c0d02423b..a23b637c8 100644 --- a/src/fold.c +++ b/src/fold.c @@ -255,6 +255,10 @@ main (int argc, char **argv) int errs = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + break_spaces = count_bytes = have_read_stdin = 0; /* Turn any numeric options into -w options. */ diff --git a/src/head.c b/src/head.c index 7b59d486e..a0415801e 100644 --- a/src/head.c +++ b/src/head.c @@ -258,6 +258,10 @@ main (int argc, char **argv) int c; /* Option character. */ program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + have_read_stdin = 0; unit_size = 0; print_headers = 0; diff --git a/src/join.c b/src/join.c index 4c9c71b39..85bd6cf0b 100644 --- a/src/join.c +++ b/src/join.c @@ -774,6 +774,9 @@ main (int argc, char **argv) int optc, prev_optc = 0, nfiles; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); /* Initialize this before parsing options. In parsing options, it may be increased. */ diff --git a/src/md5sum.c b/src/md5sum.c index 0329d8dfe..2e2759d0f 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -399,6 +399,9 @@ main (int argc, char **argv) /* Setting values of global variables. */ program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "md5sum", version_string, usage); diff --git a/src/nl.c b/src/nl.c index 55a3a077a..0ac34979c 100644 --- a/src/nl.c +++ b/src/nl.c @@ -466,6 +466,10 @@ main (int argc, char **argv) int c, exit_status = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + have_read_stdin = 0; while ((c = getopt_long (argc, argv, "h:b:f:v:i:pl:s:w:n:d:", longopts, diff --git a/src/od.c b/src/od.c index c54e253a6..8cca7b9b8 100644 --- a/src/od.c +++ b/src/od.c @@ -1586,6 +1586,10 @@ main (int argc, char **argv) #endif program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + err = 0; for (i = 0; i <= MAX_INTEGRAL_TYPE_SIZE; i++) diff --git a/src/paste.c b/src/paste.c index 50e53b177..395c6bcaf 100644 --- a/src/paste.c +++ b/src/paste.c @@ -437,6 +437,10 @@ main (int argc, char **argv) char default_delims[2], zero_delims[3]; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + have_read_stdin = 0; serial_merge = 0; delims = default_delims; diff --git a/src/pr.c b/src/pr.c index 99fea937b..be9356dae 100644 --- a/src/pr.c +++ b/src/pr.c @@ -467,6 +467,9 @@ main (int argc, char **argv) char **file_names; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); n_files = 0; file_names = (argc > 1 diff --git a/src/sort.c b/src/sort.c index 40336caab..53737a9ee 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1674,6 +1674,9 @@ main (int argc, char **argv) #endif /* SA_INTERRUPT */ program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); parse_long_options (argc, argv, "sort", version_string, usage); diff --git a/src/split.c b/src/split.c index d589a9f9d..bdc89e551 100644 --- a/src/split.c +++ b/src/split.c @@ -370,6 +370,9 @@ main (int argc, char **argv) int digits_optind = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); /* Parse command line options. */ diff --git a/src/sum.c b/src/sum.c index 413f8346e..df22ff897 100644 --- a/src/sum.c +++ b/src/sum.c @@ -207,6 +207,10 @@ main (int argc, char **argv) int (*sum_func) () = bsd_sum_file; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + have_read_stdin = 0; while ((optc = getopt_long (argc, argv, "rs", longopts, (int *) 0)) != -1) diff --git a/src/tac.c b/src/tac.c index d96e17796..54c10d0b4 100644 --- a/src/tac.c +++ b/src/tac.c @@ -588,6 +588,10 @@ main (int argc, char **argv) int have_read_stdin = 0; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + errors = 0; separator = "\n"; sentinel_length = 1; diff --git a/src/tail.c b/src/tail.c index a54945335..c4c80caf3 100644 --- a/src/tail.c +++ b/src/tail.c @@ -851,6 +851,10 @@ main (int argc, char **argv) int fileind; /* Index in ARGV of first file name. */ program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + have_read_stdin = 0; count_lines = 1; forever = forever_multiple = from_start = print_headers = 0; diff --git a/src/tr.c b/src/tr.c index eda215664..9b6e7923c 100644 --- a/src/tr.c +++ b/src/tr.c @@ -1796,6 +1796,9 @@ main (int argc, char **argv) struct Spec_list *s2 = &buf2; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); while ((c = getopt_long (argc, argv, "cdst", long_options, (int *) 0)) != EOF) diff --git a/src/unexpand.c b/src/unexpand.c index 9ea05ab15..0d0959474 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -383,12 +383,16 @@ main (int argc, char **argv) int tabval = -1; /* Value of tabstop being read, or -1. */ int c; /* Option character. */ + program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + have_read_stdin = 0; exit_status = 0; convert_entire_line = 0; tab_list = NULL; first_free_tab = 0; - program_name = argv[0]; while ((c = getopt_long (argc, argv, "at:,0123456789", longopts, (int *) 0)) != EOF) diff --git a/src/uniq.c b/src/uniq.c index 64a3b8c9c..d6900ceff 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -280,6 +280,10 @@ main (int argc, char **argv) char *infile = "-", *outfile = "-"; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + skip_chars = 0; skip_fields = 0; check_chars = 0; diff --git a/src/wc.c b/src/wc.c index bb903f1a2..27db2a436 100644 --- a/src/wc.c +++ b/src/wc.c @@ -261,6 +261,10 @@ main (int argc, char **argv) int nfiles; program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + exit_status = 0; print_lines = print_words = print_chars = 0; total_lines = total_words = total_chars = 0; -- cgit v1.2.3-54-g00ecf