Skip to content
Snippets Groups Projects
Commit fd8a3476 authored by deuce's avatar deuce
Browse files

Massage LANG to lang.IBM437 to avoid UTF-8 weirdness.

No system seems to actually install en_??.IBM437, but that's what it should
be called, and it falls back to C so good enough I guess.
parent d9aeaae3
No related branches found
No related tags found
No related merge requests found
......@@ -389,7 +389,7 @@ int pty_connect(struct bbslist *bbs)
{
struct winsize ws;
struct termios ts;
char *termcap;
char *termcap, *lang, *slang, *dot;
int cols, rows;
ts.c_iflag = TTYDEF_IFLAG;
......@@ -442,6 +442,19 @@ int pty_connect(struct bbslist *bbs)
termcap=xp_asprintf("%d",ws.ws_row);
setenv("LINES",termcap,1);
xp_asprintf_free(termcap);
setenv("MM_CHARSET", "IBM437", 1);
lang = getenv("LANG");
if (lang) {
slang = strdup(lang);
dot = strchr(slang, '.');
if (slang && dot) {
*dot = 0;
lang = xp_asprintf("%s.IBM437", slang);
setenv("LANG", lang, 1);
xp_asprintf_free(lang);
free(slang);
}
}
if(bbs->addr[0])
execl("/bin/sh", "/bin/sh", "-c", bbs->addr, (char *)0);
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment