Bugzilla – Attachment 2908 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 an ASCII tolower replacement for lowercasing strings
bz2643.diff (text/plain), 1.95 KB, created by
Damien Miller
on 2016-12-09 12:46:59 AEDT
(
hide
)
Description:
use an ASCII tolower replacement for lowercasing strings
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2016-12-09 12:46:59 AEDT
Size:
1.95 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 07d4179..be68005 100644 >--- a/misc.c >+++ b/misc.c >@@ -1141,11 +1141,19 @@ iptos2str(int iptos) > return iptos_str; > } > >+int >+tolowerc(int c) >+{ >+ if (c < (int)'A' || c > (int)'Z') >+ return c; >+ return c - ((int)'A' - (int)'a'); >+} >+ > 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 3578e8e..d598789 100644 >--- a/misc.h >+++ b/misc.h >@@ -62,7 +62,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
Flags:
dtucker
:
ok-
Actions:
View
|
Diff
Attachments on
bug 2643
:
2908
|
2910
|
2911
|
2912
|
2913