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 / +9 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 (c < (int)'A' || c > (int)'Z')
1148
		return c;
1149
	return c - ((int)'A' - (int)'a');
1150
}
1151
1144
void
1152
void
1145
lowercase(char *s)
1153
lowercase(char *s)
1146
{
1154
{
1147
	for (; *s; s++)
1155
	for (; *s; s++)
1148
		*s = tolower((u_char)*s);
1156
		*s = tolowerc((u_char)*s);
1149
}
1157
}
1150
1158
1151
int
1159
int
(-)a/misc.h (-1 / +2 lines)
Lines 62-68 void ms_subtract_diff(struct timeval *, int *); Link Here
62
void	 ms_to_timeval(struct timeval *, int);
62
void	 ms_to_timeval(struct timeval *, int);
63
time_t	 monotime(void);
63
time_t	 monotime(void);
64
double	 monotime_double(void);
64
double	 monotime_double(void);
65
void	 lowercase(char *s);
65
int	 tolowerc(int c); /* NB. always uses C locale */
66
void	 lowercase(char *s); /* NB. always uses C locale */
66
int	 unix_listener(const char *, int, int);
67
int	 unix_listener(const char *, int, int);
67
68
68
void	 sock_set_v6only(int);
69
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