diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2010-05-14 09:56:37 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2010-05-14 09:56:37 +0000 |
| commit | 05b1a8f1e3595beab4397e25c2a6db9d832a6a97 (patch) | |
| tree | 282923e87cbaf9d634dab4a7c69ce85d602effcf /src/http/ngx_http_core_module.c | |
| parent | 328df7a5cc91180fef3b1b58129e14bc79bef80b (diff) | |
| download | nginx-05b1a8f1e3595beab4397e25c2a6db9d832a6a97.tar.gz nginx-05b1a8f1e3595beab4397e25c2a6db9d832a6a97.tar.bz2 | |
ngx_str_set() and ngx_str_null()
Diffstat (limited to 'src/http/ngx_http_core_module.c')
| -rw-r--r-- | src/http/ngx_http_core_module.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 29ff64c08..23e938897 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1685,8 +1685,7 @@ ngx_http_set_exten(ngx_http_request_t *r) { ngx_int_t i; - r->exten.len = 0; - r->exten.data = NULL; + ngx_str_null(&r->exten); for (i = r->uri.len - 1; i > 1; i--) { if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') { @@ -2187,8 +2186,7 @@ ngx_http_internal_redirect(ngx_http_request_t *r, r->args = *args; } else { - r->args.len = 0; - r->args.data = NULL; + ngx_str_null(&r->args); } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, @@ -3032,8 +3030,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) conf->root_values = prev->root_values; if (prev->root.data == NULL) { - conf->root.len = sizeof("html") - 1; - conf->root.data = (u_char *) "html"; + ngx_str_set(&conf->root, "html"); if (ngx_conf_full_name(cf->cycle, &conf->root, 0) != NGX_OK) { return NGX_CONF_ERROR; @@ -3891,8 +3888,7 @@ ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) return NGX_CONF_ERROR; } - args.len = 0; - args.data = NULL; + ngx_str_null(&args); if (cv.lengths == NULL && uri.data[0] == '/') { p = (u_char *) ngx_strchr(uri.data, '?'); |
