View | Details | Raw Unified | Return to bug 2643 | Differences between
and this patch

Collapse All | Expand All

(-)a/match.c (-1 / +2 lines)
Lines 44-49 Link Here
44
#include <string.h>
44
#include <string.h>
45
45
46
#include "xmalloc.h"
46
#include "xmalloc.h"
47
#include "misc.h"
47
#include "match.h"
48
#include "match.h"
48
49
49
/*
50
/*
Lines 140-146 match_pattern_list(const char *string, const char *pattern, int dolower) Link Here
140
		    i < len && subi < sizeof(sub) - 1 && pattern[i] != ',';
141
		    i < len && subi < sizeof(sub) - 1 && pattern[i] != ',';
141
		    subi++, i++)
142
		    subi++, i++)
142
			sub[subi] = dolower && isupper((u_char)pattern[i]) ?
143
			sub[subi] = dolower && isupper((u_char)pattern[i]) ?
143
			    tolower((u_char)pattern[i]) : pattern[i];
144
			    tolowerc((u_char)pattern[i]) : pattern[i];
144
		/* If subpattern too long, return failure (no match). */
145
		/* If subpattern too long, return failure (no match). */
145
		if (subi >= sizeof(sub) - 1)
146
		if (subi >= sizeof(sub) - 1)
146
			return 0;
147
			return 0;
(-)a/misc.c (-1 / +15 lines)
Lines 1141-1151 iptos2str(int iptos) Link Here
1141
	return iptos_str;
1141
	return iptos_str;
1142
}
1142
}
1143
1143
1144
int
1145
tolowerc(int c)
1146
{
1147
	if (!isupper(c))
1148
		return c;
1149
	/*
1150
	 * Turkish locales have { upper, lower } x { dotted. dotless } 'I'
1151
	 * but we want 'I' => 'i'.
1152
	 */
1153
	if (c == (int)'I')
1154
		return (int)'i';
1155
	return tolower(c);
1156
}
1157
1144
void
1158
void
1145
lowercase(char *s)
1159
lowercase(char *s)
1146
{
1160
{
1147
	for (; *s; s++)
1161
	for (; *s; s++)
1148
		*s = tolower((u_char)*s);
1162
		*s = tolowerc((u_char)*s);
1149
}
1163
}
1150
1164
1151
int
1165
int
(-)a/misc.h (-1 / +2 lines)
Lines 63-69 void ms_subtract_diff(struct timeval *, int *); Link Here
63
void	 ms_to_timeval(struct timeval *, int);
63
void	 ms_to_timeval(struct timeval *, int);
64
time_t	 monotime(void);
64
time_t	 monotime(void);
65
double	 monotime_double(void);
65
double	 monotime_double(void);
66
void	 lowercase(char *s);
66
int	 tolowerc(int c); /* NB. always uses C locale */
67
void	 lowercase(char *s); /* NB. always uses C locale */
67
int	 unix_listener(const char *, int, int);
68
int	 unix_listener(const char *, int, int);
68
69
69
void	 sock_set_v6only(int);
70
void	 sock_set_v6only(int);
(-)a/readconf.c (-1 / +1 lines)
Lines 687-693 valid_domain(char *name, const char *filename, int linenum) Link Here
687
		fatal("%s line %d: hostname suffix \"%.100s\" "
687
		fatal("%s line %d: hostname suffix \"%.100s\" "
688
		    "starts with invalid character", filename, linenum, name);
688
		    "starts with invalid character", filename, linenum, name);
689
	for (i = 0; i < l; i++) {
689
	for (i = 0; i < l; i++) {
690
		c = tolower((u_char)name[i]);
690
		c = tolowerc((u_char)name[i]);
691
		name[i] = (char)c;
691
		name[i] = (char)c;
692
		if (last == '.' && c == '.')
692
		if (last == '.' && c == '.')
693
			fatal("%s line %d: hostname suffix \"%.100s\" contains "
693
			fatal("%s line %d: hostname suffix \"%.100s\" contains "

Return to bug 2643