Bugzilla – Attachment 2910 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]
use ctype functions instead of roll-ur-own
bz2643.diff (text/plain), 2.07 KB, created by
Damien Miller
on 2016-12-09 13:59:13 AEDT
(
hide
)
Description:
use ctype functions instead of roll-ur-own
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2016-12-09 13:59:13 AEDT
Size:
2.07 KB
patch
obsolete
>diff --git a/match.c b/match.c >index c15dcd1..ced8b14 100644 >--- a/match.c >+++ b/match.c >@@ -44,6 +44,7 @@ > #include <string.h> > > #include "xmalloc.h" >+#include "misc.h" > #include "match.h" > > /* >@@ -140,7 +141,7 @@ match_pattern_list(const char *string, const char *pattern, int dolower) > i < len && subi < sizeof(sub) - 1 && pattern[i] != ','; > subi++, i++) > sub[subi] = dolower && isupper((u_char)pattern[i]) ? >- tolower((u_char)pattern[i]) : pattern[i]; >+ tolowerc((u_char)pattern[i]) : pattern[i]; > /* If subpattern too long, return failure (no match). */ > if (subi >= sizeof(sub) - 1) > return 0; >diff --git a/misc.c b/misc.c >index 65c9222..f58e506 100644 >--- a/misc.c >+++ b/misc.c >@@ -1141,11 +1141,25 @@ iptos2str(int iptos) > return iptos_str; > } > >+int >+tolowerc(int c) >+{ >+ if (!isupper(c)) >+ return c; >+ /* >+ * Turkish locales have { upper, lower } x { dotted. dotless } 'I' >+ * but we want 'I' => 'i'. >+ */ >+ if (c == (int)'I') >+ return (int)'i'; >+ return tolower(c); >+} >+ > void > lowercase(char *s) > { > for (; *s; s++) >- *s = tolower((u_char)*s); >+ *s = tolowerc((u_char)*s); > } > > int >diff --git a/misc.h b/misc.h >index c242f90..be00e3d 100644 >--- a/misc.h >+++ b/misc.h >@@ -63,7 +63,8 @@ void ms_subtract_diff(struct timeval *, int *); > void ms_to_timeval(struct timeval *, int); > time_t monotime(void); > double monotime_double(void); >-void lowercase(char *s); >+int tolowerc(int c); /* NB. always uses C locale */ >+void lowercase(char *s); /* NB. always uses C locale */ > int unix_listener(const char *, int, int); > > void sock_set_v6only(int); >diff --git a/readconf.c b/readconf.c >index fa3fab8..11970e7 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -687,7 +687,7 @@ valid_domain(char *name, const char *filename, int linenum) > fatal("%s line %d: hostname suffix \"%.100s\" " > "starts with invalid character", filename, linenum, name); > for (i = 0; i < l; i++) { >- c = tolower((u_char)name[i]); >+ c = tolowerc((u_char)name[i]); > name[i] = (char)c; > if (last == '.' && c == '.') > fatal("%s line %d: hostname suffix \"%.100s\" contains "
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