comparison src/http/modules/ngx_http_sub_filter_module.c @ 4947:4251e72b8bb4

Allow the complex value to be defined as an empty string. This makes conversion from strings to complex values possible without the loss of functionality.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 06 Dec 2012 23:03:53 +0000
parents 4a18bf1833a9
children 4c1a604b0285
comparison
equal deleted inserted replaced
4946:2570296374b4 4947:4251e72b8bb4
626 ngx_http_sub_loc_conf_t *slcf = conf; 626 ngx_http_sub_loc_conf_t *slcf = conf;
627 627
628 ngx_str_t *value; 628 ngx_str_t *value;
629 ngx_http_compile_complex_value_t ccv; 629 ngx_http_compile_complex_value_t ccv;
630 630
631 if (slcf->match.len) { 631 if (slcf->match.data) {
632 return "is duplicate"; 632 return "is duplicate";
633 } 633 }
634 634
635 value = cf->args->elts; 635 value = cf->args->elts;
636 636
686 ngx_http_sub_loc_conf_t *conf = child; 686 ngx_http_sub_loc_conf_t *conf = child;
687 687
688 ngx_conf_merge_value(conf->once, prev->once, 1); 688 ngx_conf_merge_value(conf->once, prev->once, 1);
689 ngx_conf_merge_str_value(conf->match, prev->match, ""); 689 ngx_conf_merge_str_value(conf->match, prev->match, "");
690 690
691 if (conf->value.value.len == 0) { 691 if (conf->value.value.data == NULL) {
692 conf->value = prev->value; 692 conf->value = prev->value;
693 } 693 }
694 694
695 if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types, 695 if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
696 &prev->types_keys, &prev->types, 696 &prev->types_keys, &prev->types,