support multibyte input to menu code; from Alexander Polakov with a tiny tweak.

This commit is contained in:
okan
2012-08-07 14:05:49 +00:00
parent 013497c79c
commit 7071261bde
2 changed files with 24 additions and 21 deletions

View File

@@ -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':