Sorry I forget to attach the patch.

---------- Forwarded message ----------
From: Ángel Alonso <[email protected]>
Date: Mon, 25 May 2009 13:48:55 -0700
Subject: [Patch] warning in setlocale()
To: [email protected]

Shows a warning if the locale cannot be set.

I attach the patch.

NOTE: In Xlib you have a function called XSupportsLocale(), I didn't find
anything similar in xcb.
From 92761316de40b0cac70dd5eca34ed72d7a84e07c Mon Sep 17 00:00:00 2001
From: feler <[email protected]>
Date: Tue, 26 May 2009 22:40:20 -0700
Subject: [PATCH] warning_setlocale

---
 awesome.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/awesome.c b/awesome.c
index 321d98e..e6672e6 100644
--- a/awesome.c
+++ b/awesome.c
@@ -354,7 +354,8 @@ main(int argc, char **argv)
     }
 
     /* Text won't be printed correctly otherwise */
-    setlocale(LC_CTYPE, "");
+    if(!setlocale(LC_CTYPE, ""))
+        fprintf(stderr, "warning: cannot set locale.\n");
 
     /* Get XDG basedir data */
     xdgInitHandle(&xdg);
-- 
1.6.2.4

Reply via email to