aboutsummaryrefslogtreecommitdiffstats
path: root/calmwm.c
diff options
context:
space:
mode:
authorokan2012-08-07 14:05:49 +0000
committerokan2012-08-07 14:05:49 +0000
commit27c19dc76dec9d1f5bc83b63aac5278b5c5e24c2 (patch)
tree7528d12af710b7303c2ffede819b333013c74515 /calmwm.c
parent1b981a5d166590176f6bff12fe483602e7b86d2a (diff)
downloadcwm-27c19dc76dec9d1f5bc83b63aac5278b5c5e24c2.tar.gz
support multibyte input to menu code; from Alexander Polakov with a tiny tweak.
Diffstat (limited to '')
-rw-r--r--calmwm.c7
1 files changed, 6 insertions, 1 deletions
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 <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':