From 27c19dc76dec9d1f5bc83b63aac5278b5c5e24c2 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 7 Aug 2012 14:05:49 +0000 Subject: support multibyte input to menu code; from Alexander Polakov with a tiny tweak. --- calmwm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'calmwm.c') diff --git a/calmwm.c b/calmwm.c index 73526ba..a9a7cd2 100644 --- a/calmwm.c +++ b/calmwm.c @@ -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 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -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': -- cgit v1.2.3-2-gb3c3