[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] [PATCH 07/14] Ensure main calls bindtextdomain
From: |
gscrivano |
Subject: |
[Bug-wget] [PATCH 07/14] Ensure main calls bindtextdomain |
Date: |
Wed, 11 Jun 2014 17:05:18 +0200 |
From: Giuseppe Scrivano <address@hidden>
---
ChangeLog | 4 ++++
src/ChangeLog | 9 +++++++++
src/decc_ver.c | 9 +++++++++
src/hash.c | 9 +++++++++
src/html-parse.c | 8 ++++++++
src/netrc.c | 8 ++++++++
src/test.c | 8 ++++++++
util/trunc.c | 8 ++++++++
8 files changed, 63 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 4cfd923..8c310c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-11 Giuseppe Scrivano <address@hidden>
+
+ * util/trunc.c (main): Ensure bindtextdomain is called.
+
2014-06-10 Giuseppe Scrivano <address@hidden>
* build-aux/build_info.pl: Remove trailing whitespaces.
diff --git a/src/ChangeLog b/src/ChangeLog
index dbe1028..91abc52 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2014-06-11 Giuseppe Scrivano <address@hidden>
+
+ * decc_ver.c (main): Ensure bindtextdomain is called.
+ * hash.c (main): Likewise.
+ * html-parse.c: Likewise.
+ * netrc.c: Likewise.
+ * test.c: Likewise.
+ * trunc.c: Likewise.
+
2014-06-10 Giuseppe Scrivano <address@hidden>
* wget.h: Remove trailing whitespaces.
diff --git a/src/decc_ver.c b/src/decc_ver.c
index 8d9e514..6eb7a9d 100644
--- a/src/decc_ver.c
+++ b/src/decc_ver.c
@@ -2,6 +2,15 @@
int main( void)
{
+
+#ifdef ENABLE_NLS
+ /* Set the current locale. */
+ setlocale (LC_ALL, "");
+ /* Set the text message domain. */
+ bindtextdomain ("wget", LOCALEDIR);
+ textdomain ("wget");
+#endif /* ENABLE_NLS */
+
#ifdef __VMS_VERSION
printf( " __VMS_VERSION: >%s<.\n", __VMS_VERSION);
#else /* def __VMS_VERSION */
diff --git a/src/hash.c b/src/hash.c
index 129ead1..af8e583 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -767,6 +767,15 @@ main (void)
{
struct hash_table *ht = make_string_hash_table (0);
char line[80];
+
+#ifdef ENABLE_NLS
+ /* Set the current locale. */
+ setlocale (LC_ALL, "");
+ /* Set the text message domain. */
+ bindtextdomain ("wget", LOCALEDIR);
+ textdomain ("wget");
+#endif /* ENABLE_NLS */
+
while ((fgets (line, sizeof (line), stdin)))
{
int len = strlen (line);
diff --git a/src/html-parse.c b/src/html-parse.c
index 20791cd..f9418c7 100644
--- a/src/html-parse.c
+++ b/src/html-parse.c
@@ -1189,6 +1189,14 @@ int main ()
int read_count;
int tag_counter = 0;
+#ifdef ENABLE_NLS
+ /* Set the current locale. */
+ setlocale (LC_ALL, "");
+ /* Set the text message domain. */
+ bindtextdomain ("wget", LOCALEDIR);
+ textdomain ("wget");
+#endif /* ENABLE_NLS */
+
while ((read_count = fread (x + length, 1, size - length, stdin)))
{
length += read_count;
diff --git a/src/netrc.c b/src/netrc.c
index 5fc34cc..bad574d 100644
--- a/src/netrc.c
+++ b/src/netrc.c
@@ -455,6 +455,14 @@ main (int argc, char **argv)
file = argv[1];
target = argv[2];
+#ifdef ENABLE_NLS
+ /* Set the current locale. */
+ setlocale (LC_ALL, "");
+ /* Set the text message domain. */
+ bindtextdomain ("wget", LOCALEDIR);
+ textdomain ("wget");
+#endif /* ENABLE_NLS */
+
if (stat (file, &sb))
{
fprintf (stderr, _("%s: cannot stat %s: %s\n"), argv[0], file,
diff --git a/src/test.c b/src/test.c
index 68c4863..c8351ca 100644
--- a/src/test.c
+++ b/src/test.c
@@ -75,6 +75,14 @@ main (int argc _GL_UNUSED, char *argv[])
{
const char *result;
+#ifdef ENABLE_NLS
+ /* Set the current locale. */
+ setlocale (LC_ALL, "");
+ /* Set the text message domain. */
+ bindtextdomain ("wget", LOCALEDIR);
+ textdomain ("wget");
+#endif /* ENABLE_NLS */
+
program_name = argv[0];
result = all_tests();
diff --git a/util/trunc.c b/util/trunc.c
index a5f1dcb..9428507 100644
--- a/util/trunc.c
+++ b/util/trunc.c
@@ -76,6 +76,14 @@ main (int argc, char *argv[])
int option;
int fd;
+#ifdef ENABLE_NLS
+ /* Set the current locale. */
+ setlocale (LC_ALL, "");
+ /* Set the text message domain. */
+ bindtextdomain ("wget", LOCALEDIR);
+ textdomain ("wget");
+#endif /* ENABLE_NLS */
+
/* Parse options. */
while ((option = getopt (argc, argv, "c")) != -1)
{
--
1.9.3
- [Bug-wget] [PATCH 02/14] Do not use exit() with a magic number, (continued)
- [Bug-wget] [PATCH 02/14] Do not use exit() with a magic number, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 03/14] Do not include strings.h, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 06/14] Remove trailing whitespaces, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 04/14] Drop usage of strncpy, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 08/14] Remove trailing empty lines, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 09/14] Replace @VAR@ in Makefile.am files with $VAR, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 05/14] Update fdl.texi from gnulib, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 07/14] Ensure main calls bindtextdomain,
gscrivano <=
- [Bug-wget] [PATCH 10/14] Do not depend on always defined macros, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 11/14] po/POTFILES.in: add missing file, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 13/14] Remove duplicated words, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 12/14] gnutls: do not include <assert.h>, gscrivano, 2014/06/11
- [Bug-wget] [PATCH 14/14] ftp: Replace main() with main in comments., gscrivano, 2014/06/11