Perl: fixed syntax usage for C preprocessor directives.

As per perlxs, C preprocessor directives should be at the first
non-whitespace of a line to avoid interpreting them as comments.

#if and #endif are moved so that there are no blank lines before them
to retain them as part of the function body.
This commit is contained in:
Sergey Kandaurov 2013-07-29 17:30:01 +04:00
parent e49d933ebc
commit ab1c05272a

View File

@ -261,13 +261,12 @@ header_in(r, key)
sep = ';'; sep = ';';
goto multi; goto multi;
} }
#if (NGX_HTTP_X_FORWARDED_FOR)
#if (NGX_HTTP_X_FORWARDED_FOR)
if (hh->offset == offsetof(ngx_http_headers_in_t, x_forwarded_for)) { if (hh->offset == offsetof(ngx_http_headers_in_t, x_forwarded_for)) {
sep = ','; sep = ',';
goto multi; goto multi;
} }
#endif #endif
if (hh->offset) { if (hh->offset) {
@ -898,8 +897,7 @@ variable(r, name, value = NULL)
var.len = len; var.len = len;
var.data = lowcase; var.data = lowcase;
#if (NGX_DEBUG)
#if (NGX_DEBUG)
if (value) { if (value) {
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@ -908,8 +906,7 @@ variable(r, name, value = NULL)
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"perl variable: \"%V\"", &var); "perl variable: \"%V\"", &var);
} }
#endif
#endif
vv = ngx_http_get_variable(r, &var, hash); vv = ngx_http_get_variable(r, &var, hash);
if (vv == NULL) { if (vv == NULL) {