comparison src/http/ngx_http_core_module.c @ 468:56baf312c1b5 NGINX_0_7_46

nginx 0.7.46 *) Bugfix: the previous release tarball was incorrect.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Mar 2009 00:00:00 +0400
parents c8cfb6c462ef
children f2c6a7373274
comparison
equal deleted inserted replaced
467:d46142e61c30 468:56baf312c1b5
1693 } 1693 }
1694 1694
1695 last = ngx_copy(path->data, clcf->root.data, clcf->root.len); 1695 last = ngx_copy(path->data, clcf->root.data, clcf->root.len);
1696 1696
1697 } else { 1697 } else {
1698 reserved += alias ? 1 : r->uri.len + 1; 1698
1699 #if (NGX_PCRE)
1700 ngx_uint_t captures;
1701
1702 captures = alias && clcf->captures;
1703 reserved += captures ? 1 : r->uri.len - alias + 1;
1704 #else
1705 reserved += r->uri.len - alias + 1;
1706 #endif
1699 1707
1700 if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved, 1708 if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved,
1701 clcf->root_values->elts) 1709 clcf->root_values->elts)
1702 == NULL) 1710 == NULL)
1703 { 1711 {
1709 } 1717 }
1710 1718
1711 *root_length = path->len - reserved; 1719 *root_length = path->len - reserved;
1712 last = path->data + *root_length; 1720 last = path->data + *root_length;
1713 1721
1714 if (alias) { 1722 #if (NGX_PCRE)
1723 if (captures) {
1715 *last = '\0'; 1724 *last = '\0';
1716 return last; 1725 return last;
1717 } 1726 }
1727 #endif
1718 } 1728 }
1719 1729
1720 last = ngx_cpystrn(last, r->uri.data + alias, r->uri.len - alias + 1); 1730 last = ngx_cpystrn(last, r->uri.data + alias, r->uri.len - alias + 1);
1721 1731
1722 return last; 1732 return last;