Mercurial > hg > nginx
comparison src/http/modules/ngx_http_charset_filter_module.c @ 1107:db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 14 Feb 2007 18:51:19 +0000 |
parents | 36f7b549f481 |
children | 33d6c994a0b2 |
comparison
equal
deleted
inserted
replaced
1106:2c7fed12fab7 | 1107:db7c468c447d |
---|---|
237 } | 237 } |
238 | 238 |
239 } else { | 239 } else { |
240 ct = r->headers_out.content_type.data; | 240 ct = r->headers_out.content_type.data; |
241 | 241 |
242 if (ngx_strncasecmp(ct, "text/", 5) != 0 | 242 if (ngx_strncasecmp(ct, (u_char *) "text/", 5) != 0 |
243 && ngx_strncasecmp(ct, "application/x-javascript", 24) != 0) | 243 && ngx_strncasecmp(ct, |
244 (u_char *) "application/x-javascript", 24) | |
245 != 0) | |
244 { | 246 { |
245 return ngx_http_next_header_filter(r); | 247 return ngx_http_next_header_filter(r); |
246 } | 248 } |
247 } | 249 } |
248 | 250 |
1116 } | 1118 } |
1117 | 1119 |
1118 table->src = src; | 1120 table->src = src; |
1119 table->dst = dst; | 1121 table->dst = dst; |
1120 | 1122 |
1121 if (ngx_strcasecmp(value[2].data, "utf-8") == 0) { | 1123 if (ngx_strcasecmp(value[2].data, (u_char *) "utf-8") == 0) { |
1122 table->src2dst = ngx_pcalloc(cf->pool, 256 * NGX_UTF_LEN); | 1124 table->src2dst = ngx_pcalloc(cf->pool, 256 * NGX_UTF_LEN); |
1123 if (table->src2dst == NULL) { | 1125 if (table->src2dst == NULL) { |
1124 return NGX_CONF_ERROR; | 1126 return NGX_CONF_ERROR; |
1125 } | 1127 } |
1126 | 1128 |
1370 | 1372 |
1371 c->tables = NULL; | 1373 c->tables = NULL; |
1372 c->name = *name; | 1374 c->name = *name; |
1373 c->length = 0; | 1375 c->length = 0; |
1374 | 1376 |
1375 if (ngx_strcasecmp(name->data, "utf-8") == 0) { | 1377 if (ngx_strcasecmp(name->data, (u_char *) "utf-8") == 0) { |
1376 c->utf8 = 1; | 1378 c->utf8 = 1; |
1377 | 1379 |
1378 } else { | 1380 } else { |
1379 c->utf8 = 0; | 1381 c->utf8 = 0; |
1380 } | 1382 } |