diff options
author | okan | 2012-08-07 14:05:49 +0000 |
---|---|---|
committer | okan | 2012-08-07 14:05:49 +0000 |
commit | 27c19dc76dec9d1f5bc83b63aac5278b5c5e24c2 (patch) | |
tree | 7528d12af710b7303c2ffede819b333013c74515 /calmwm.c | |
parent | 1b981a5d166590176f6bff12fe483602e7b86d2a (diff) | |
download | cwm-27c19dc76dec9d1f5bc83b63aac5278b5c5e24c2.tar.gz |
support multibyte input to menu code; from Alexander Polakov with a tiny tweak.
Diffstat (limited to 'calmwm.c')
-rw-r--r-- | calmwm.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.c,v 1.64 2012/07/18 21:53:22 okan Exp $ + * $OpenBSD: calmwm.c,v 1.65 2012/08/07 14:05:49 okan Exp $ */ #include <sys/param.h> @@ -25,6 +25,7 @@ #include <err.h> #include <errno.h> #include <getopt.h> +#include <locale.h> #include <signal.h> #include <stdlib.h> #include <string.h> @@ -62,6 +63,10 @@ main(int argc, char **argv) char *display_name = NULL; int ch; + if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) + warnx("no locale support"); + mbtowc(NULL, NULL, MB_CUR_MAX); + while ((ch = getopt(argc, argv, "c:d:")) != -1) { switch (ch) { case 'c': |