[gnome-terminal] server: Exit on unsupported locale
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] server: Exit on unsupported locale
- Date: Tue, 14 Jul 2015 17:37:50 +0000 (UTC)
commit e77c708f33eaed7e879ea9f3537d69d87ebae95a
Author: Christian Persch <chpe gnome org>
Date: Tue Jul 14 19:37:27 2015 +0200
server: Exit on unsupported locale
src/server.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/server.c b/src/server.c
index 8d3a7d8..a467eac 100644
--- a/src/server.c
+++ b/src/server.c
@@ -101,6 +101,7 @@ increase_rlimit_nofile (void)
enum {
_EXIT_FAILURE_WRONG_ID = 7,
_EXIT_FAILURE_NO_UTF8 = 8,
+ _EXIT_FAILURE_UNSUPPORTED_LOCALE = 9
};
int
@@ -118,7 +119,10 @@ main (int argc, char **argv)
return _EXIT_FAILURE_WRONG_ID;
}
- setlocale (LC_ALL, "");
+ if (setlocale (LC_ALL, "") == NULL) {
+ g_printerr ("Locale not supported.\n");
+ return _EXIT_FAILURE_UNSUPPORTED_LOCALE;
+ }
terminal_i18n_init (TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]