Skip to content

Commit

Permalink
Merge branch 'obsd-master'
Browse files Browse the repository at this point in the history
Conflicts:
	tmux.c
  • Loading branch information
ThomasAdam committed Mar 5, 2016
2 parents 81f78f0 + 0d6de44 commit 5fc5c03
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <errno.h>
#include <event.h>
#include <fcntl.h>
#include <getopt.h>
#include <langinfo.h>
#include <locale.h>
#include <pwd.h>
#include <stdlib.h>
Expand Down Expand Up @@ -190,10 +192,14 @@ main(int argc, char **argv)
const char *s;
int opt, flags, keys;

if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL)
setlocale(LC_CTYPE, "");
if (wcwidth(0xfffd) != 1)
errx(1, "no UTF-8 locale; please set LC_CTYPE");
if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) {
if (setlocale(LC_CTYPE, "") == NULL)
errx(1, "invalid LC_ALL, LC_CTYPE or LANG");
s = nl_langinfo(CODESET);
if (strcasecmp(s, "UTF-8") != 0 &&
strcasecmp(s, "UTF8") != 0)
errx(1, "need UTF-8 locale (LC_CTYPE) but have %s", s);
}

setlocale(LC_TIME, "");
tzset();
Expand Down

0 comments on commit 5fc5c03

Please sign in to comment.