[hackers] [dmenu] reverted setlocale() call || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Mon, 25 Aug 2008 08:38:41 +0000 (UTC)

changeset: 278:9eab432907a0
tag: tip
user: Anselm R Garbe <garbeam_AT_gmail.com>
date: Mon Aug 25 09:38:19 2008 +0100
files: dmenu.c
description:
reverted setlocale() call

diff -r f6c28c0d03c5 -r 9eab432907a0 dmenu.c
--- a/dmenu.c Sat Aug 23 09:33:56 2008 +0100
+++ b/dmenu.c Mon Aug 25 09:38:19 2008 +0100
@@ -1,6 +1,7 @@
 /* See LICENSE file for copyright and license details. */
 #define _BSD_SOURCE
 #include <ctype.h>
+#include <locale.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -705,7 +706,7 @@
                 else
                         eprint("usage: dmenu [-i] [-b] [-fn <font>] [-nb <color>] [-nf <color>]\n"
                                " [-p <prompt>] [-sb <color>] [-sf <color>] [-v]\n");
- if(!XSupportsLocale())
+ if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
                 fprintf(stderr, "warning: no locale support\n");
         if(!(dpy = XOpenDisplay(0)))
                 eprint("dmenu: cannot open display\n");
Received on Mon Aug 25 2008 - 08:38:41 UTC

This archive was generated by hypermail 2.2.0 : Mon Aug 25 2008 - 08:48:07 UTC