summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-11-17 11:34:58 +0000
committerColin Watson <cjwatson@debian.org>2010-11-17 11:34:58 +0000
commit10c16d26f89589d4eb219cf3491f447d56cbfce4 (patch)
treeaaab38d5ede76f6b59b200adf9693dbccabeb61f
parent90da5dbbeb8bd51498473b212ce3297460b5415d (diff)
* lib/util.c (init_locale): Avoid warnings if configured with
--disable-nls. Remove arguments, since this was only ever called as 'init_locale (LC_ALL, "")' anyway, and that required callers to explicitly include <locale.h>. Update all callers. * include/manconfig.h.in (init_locale): Update prototype.
-rw-r--r--ChangeLog8
-rw-r--r--NEWS2
-rw-r--r--include/manconfig.h.in2
-rw-r--r--lib/util.c6
-rw-r--r--src/accessdb.c2
-rw-r--r--src/catman.c2
-rw-r--r--src/globbing_test.c2
-rw-r--r--src/lexgrog_test.c2
-rw-r--r--src/man.c2
-rw-r--r--src/manconv_main.c2
-rw-r--r--src/mandb.c2
-rw-r--r--src/manpath.c2
-rw-r--r--src/whatis.c2
-rw-r--r--src/zsoelim_main.c2
14 files changed, 25 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 09f739c3..e3eb794d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Nov 17 11:34:36 GMT 2010 Colin Watson <cjwatson@debian.org>
+
+ * lib/util.c (init_locale): Avoid warnings if configured with
+ --disable-nls. Remove arguments, since this was only ever called
+ as 'init_locale (LC_ALL, "")' anyway, and that required callers to
+ explicitly include <locale.h>. Update all callers.
+ * include/manconfig.h.in (init_locale): Update prototype.
+
Wed Nov 17 11:22:28 GMT 2010 Colin Watson <cjwatson@debian.org>
* src/check_mandirs.c (test_manfile): Revert changes to this
diff --git a/NEWS b/NEWS
index 6b607ac4..e2933f65 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ Major changes since man-db 2.5.8:
o Fix test failures on some systems. A change made in 2.5.8 was
overly sensitive to directory ordering.
+ o Configuring with --disable-nls works again.
+
man-db 2.5.8 (15 November 2010)
===============================
diff --git a/include/manconfig.h.in b/include/manconfig.h.in
index ef2fba5c..070201c2 100644
--- a/include/manconfig.h.in
+++ b/include/manconfig.h.in
@@ -365,7 +365,7 @@ extern char *escape_shell (const char *unesc);
extern int remove_directory (const char *directory);
extern char *trim_spaces (const char *s);
extern char *lang_dir (const char *filename);
-extern char *init_locale (int category, const char *locale);
+extern char *init_locale (void);
extern char *appendstr (char *, ...)
ATTRIBUTE_SENTINEL ATTRIBUTE_WARN_UNUSED_RESULT;
diff --git a/lib/util.c b/lib/util.c
index b3fabc43..d2a9f32f 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -232,9 +232,9 @@ char *lang_dir (const char *filename)
return ld;
}
-char *init_locale (int category, const char *locale)
+char *init_locale (void)
{
- char *ret = setlocale (category, locale);
+ char *ret = setlocale (LC_ALL, "");
if (!ret &&
!getenv ("MAN_NO_LOCALE_WARNING") &&
!getenv ("DPKG_RUNNING_VERSION"))
@@ -242,8 +242,10 @@ char *init_locale (int category, const char *locale)
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
setenv ("MAN_NO_LOCALE_WARNING", "1", 1);
+#ifdef ENABLE_NLS
bindtextdomain (PACKAGE, LOCALEDIR);
bindtextdomain (PACKAGE "-gnulib", LOCALEDIR);
textdomain (PACKAGE);
+#endif /* ENABLE_NLS */
return ret;
}
diff --git a/src/accessdb.c b/src/accessdb.c
index 47d7ae3c..8b3a9ce6 100644
--- a/src/accessdb.c
+++ b/src/accessdb.c
@@ -111,7 +111,7 @@ int main (int argc, char *argv[])
program_name = base_name (argv[0]);
init_debug ();
- init_locale (LC_ALL, "");
+ init_locale ();
if (is_directory (FHS_CAT_ROOT) == 1)
cat_root = FHS_CAT_ROOT;
diff --git a/src/catman.c b/src/catman.c
index f1ba9c15..b0bda9a1 100644
--- a/src/catman.c
+++ b/src/catman.c
@@ -413,7 +413,7 @@ int main (int argc, char *argv[])
init_debug ();
- locale = xstrdup (init_locale (LC_ALL, ""));
+ locale = xstrdup (init_locale ());
if (!locale)
locale = xstrdup ("C");
diff --git a/src/globbing_test.c b/src/globbing_test.c
index 9bd80b63..31f8ffb4 100644
--- a/src/globbing_test.c
+++ b/src/globbing_test.c
@@ -108,7 +108,7 @@ int main (int argc, char **argv)
program_name = base_name (argv[0]);
init_debug ();
- init_locale (LC_ALL, "");
+ init_locale ();
if (argp_parse (&argp, argc, argv, 0, 0, 0))
exit (FAIL);
diff --git a/src/lexgrog_test.c b/src/lexgrog_test.c
index b1fe573d..1a667cfa 100644
--- a/src/lexgrog_test.c
+++ b/src/lexgrog_test.c
@@ -137,7 +137,7 @@ int main (int argc, char **argv)
init_debug ();
pipeline_install_post_fork (pop_all_cleanups);
- init_locale (LC_ALL, "");
+ init_locale ();
if (argp_parse (&argp, argc, argv, 0, 0, 0))
exit (FAIL);
diff --git a/src/man.c b/src/man.c
index b7bf1f19..71db5e73 100644
--- a/src/man.c
+++ b/src/man.c
@@ -982,7 +982,7 @@ int main (int argc, char *argv[])
pipeline_install_post_fork (pop_all_cleanups);
umask (022);
- init_locale (LC_ALL, "");
+ init_locale ();
internal_locale = setlocale (LC_MESSAGES, NULL);
/* Use LANGUAGE only when LC_MESSAGES locale category is
diff --git a/src/manconv_main.c b/src/manconv_main.c
index 0c977b26..166a2b84 100644
--- a/src/manconv_main.c
+++ b/src/manconv_main.c
@@ -154,7 +154,7 @@ int main (int argc, char *argv[])
init_debug ();
pipeline_install_post_fork (pop_all_cleanups);
- init_locale (LC_ALL, "");
+ init_locale ();
if (argp_parse (&argp, argc, argv, 0, 0, 0))
exit (FAIL);
diff --git a/src/mandb.c b/src/mandb.c
index c89de8c7..d3a849d8 100644
--- a/src/mandb.c
+++ b/src/mandb.c
@@ -580,7 +580,7 @@ int main (int argc, char *argv[])
init_debug ();
pipeline_install_post_fork (pop_all_cleanups);
- init_locale (LC_ALL, "");
+ init_locale ();
if (argp_parse (&argp, argc, argv, 0, 0, 0))
exit (FAIL);
diff --git a/src/manpath.c b/src/manpath.c
index ff70a4f4..d4579d3a 100644
--- a/src/manpath.c
+++ b/src/manpath.c
@@ -112,7 +112,7 @@ int main (int argc, char *argv[])
program_name = base_name (argv[0]);
init_debug ();
- init_locale (LC_ALL, "");
+ init_locale ();
if (argp_parse (&argp, argc, argv, 0, 0, 0))
exit (FAIL);
diff --git a/src/whatis.c b/src/whatis.c
index 424e274a..acc5a7df 100644
--- a/src/whatis.c
+++ b/src/whatis.c
@@ -704,7 +704,7 @@ int main (int argc, char *argv[])
init_debug ();
pipeline_install_post_fork (pop_all_cleanups);
- init_locale (LC_ALL, "");
+ init_locale ();
internal_locale = setlocale (LC_MESSAGES, NULL);
/* Use LANGUAGE only when LC_MESSAGES locale category is
diff --git a/src/zsoelim_main.c b/src/zsoelim_main.c
index 3596486b..9d09116a 100644
--- a/src/zsoelim_main.c
+++ b/src/zsoelim_main.c
@@ -99,7 +99,7 @@ int main (int argc, char *argv[])
init_debug ();
pipeline_install_post_fork (pop_all_cleanups);
- init_locale (LC_ALL, "");
+ init_locale ();
if (argp_parse (&argp, argc, argv, 0, 0, 0))
exit (FAIL);