Mercurial > hg > nginx
comparison src/http/modules/ngx_http_map_module.c @ 4827:6e46016ea276
Fixed the "include" directive.
The "include" directive should be able to include multiple files if
given a filename mask. Fixed this to work for "include" directives
inside the "map" or "types" blocks. The "include" directive inside
the "geo" block is still not fixed.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 28 Aug 2012 13:31:01 +0000 |
parents | 0656cfe8f7cb |
children | 8b635cf36ccc |
comparison
equal
deleted
inserted
replaced
4826:c7d549856ab6 | 4827:6e46016ea276 |
---|---|
367 | 367 |
368 static char * | 368 static char * |
369 ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) | 369 ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) |
370 { | 370 { |
371 ngx_int_t rc, index; | 371 ngx_int_t rc, index; |
372 ngx_str_t *value, file, name; | 372 ngx_str_t *value, name; |
373 ngx_uint_t i, key; | 373 ngx_uint_t i, key; |
374 ngx_http_map_conf_ctx_t *ctx; | 374 ngx_http_map_conf_ctx_t *ctx; |
375 ngx_http_variable_value_t *var, **vp; | 375 ngx_http_variable_value_t *var, **vp; |
376 | 376 |
377 ctx = cf->ctx; | 377 ctx = cf->ctx; |
389 "invalid number of the map parameters"); | 389 "invalid number of the map parameters"); |
390 return NGX_CONF_ERROR; | 390 return NGX_CONF_ERROR; |
391 } | 391 } |
392 | 392 |
393 if (ngx_strcmp(value[0].data, "include") == 0) { | 393 if (ngx_strcmp(value[0].data, "include") == 0) { |
394 file = value[1]; | 394 return ngx_conf_include(cf, dummy, conf); |
395 | |
396 if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { | |
397 return NGX_CONF_ERROR; | |
398 } | |
399 | |
400 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); | |
401 | |
402 return ngx_conf_parse(cf, &file); | |
403 } | 395 } |
404 | 396 |
405 if (value[1].data[0] == '$') { | 397 if (value[1].data[0] == '$') { |
406 name = value[1]; | 398 name = value[1]; |
407 name.len--; | 399 name.len--; |