Bugzilla – Attachment 2912 Details for
Bug 2643
Can not ssh with tr_TR.UTF-8 locale (Bad configuration options)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fall back to C locale for LC_CTYPE
bz2643.diff (text/plain), 1.09 KB, created by
Damien Miller
on 2016-12-09 16:28:55 AEDT
(
hide
)
Description:
fall back to C locale for LC_CTYPE
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2016-12-09 16:28:55 AEDT
Size:
1.09 KB
patch
obsolete
>diff --git a/ssh.c b/ssh.c >index 8aa8daa..9418d3f 100644 >--- a/ssh.c >+++ b/ssh.c >@@ -503,6 +503,36 @@ set_addrinfo_port(struct addrinfo *addrs, int port) > } > } > >+void >+xsetlocale(int unused1, const char *unused2) >+{ >+ const char *vars[] = { "LC_CTYPE", "LC_ALL", "LANG", NULL }; >+ char *cp; >+ int i; >+ >+ /* >+ * We can't yet cope with dotless/dotted I in Turkish locales, >+ * so fall back to the C locale for these. >+ */ >+ for (i = 0; vars[i] != NULL; i++) { >+ if ((cp = getenv(vars[i])) == NULL) >+ continue; >+ if (strncasecmp(cp, "TR", 2) != 0) >+ continue; >+ /* >+ * If we're in a UTF-8 locale then prefer to use >+ * C.UTF-8 locale if it exists. >+ */ >+ if (strstr(cp, "UTF-8") != NULL && >+ setlocale(LC_CTYPE, "C.UTF-8") != NULL) >+ return; >+ setlocale(LC_CTYPE, "C"); >+ return; >+ } >+ /* We can handle this locale */ >+ setlocale(LC_CTYPE, ""); >+} >+ > /* > * Main program for the ssh client. > */ >@@ -589,7 +619,7 @@ main(int ac, char **av) > */ > umask(022); > >- setlocale(LC_CTYPE, ""); >+ xsetlocale(LC_CTYPE, ""); > > /* > * Initialize option structure to indicate that no values have been
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2643
:
2908
|
2910
|
2911
|
2912
|
2913