diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2017-09-17 22:09:19 +0200 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2017-09-17 22:09:19 +0200 |
commit | 5d76519869e4bf188f748e487e083ef394e384a9 (patch) | |
tree | 912123cb076086cd74302cb4e9d62b0bff284ee0 | |
parent | 02b994196fde275a724ba767c115204ca34414e9 (diff) | |
download | ratpoison-5d76519869e4bf188f748e487e083ef394e384a9.zip |
Move utf8_locale setting in utf8.c
Less goo in main.c
-rw-r--r-- | src/main.c | 8 | ||||
-rw-r--r-- | src/utf8.c | 15 | ||||
-rw-r--r-- | src/utf8.h | 2 |
3 files changed, 17 insertions, 8 deletions
@@ -38,10 +38,6 @@ #include "ratpoison.h" -#ifdef HAVE_LANGINFO_CODESET -# include <langinfo.h> -#endif - /* Command line options */ static struct option ratpoison_longopts[] = { {"help", no_argument, 0, 'h'}, @@ -309,9 +305,7 @@ main (int argc, char *argv[]) else PRINT_ERROR (("X doesn't seem to support your locale.\n")); -#ifdef HAVE_LANGINFO_CODESET - utf8_locale = !strcmp (nl_langinfo (CODESET), "UTF-8"); -#endif + utf8_check_locale(); /* Parse the arguments */ myargv = argv; @@ -1,3 +1,16 @@ -#include "utf8.h" +#include "ratpoison.h" + +#ifdef HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif int utf8_locale; + +int +utf8_check_locale(void) +{ +#ifdef HAVE_LANGINFO_CODESET + utf8_locale = !strcmp (nl_langinfo (CODESET), "UTF-8"); +#endif + return utf8_locale; +} @@ -3,4 +3,6 @@ extern int utf8_locale; +int utf8_check_locale(void); + #endif |