From: Christophe Jaillet Date: Sun, 5 Jun 2016 08:40:20 +0000 (+0000) Subject: No need to scan the first 5 bytes, they are already correct (i.e. HTTP_) X-Git-Tag: 2.5.0-alpha~1541 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbe61c6eab12ec6ada51d3c316e5162864a41394;p=thirdparty%2Fapache%2Fhttpd.git No need to scan the first 5 bytes, they are already correct (i.e. HTTP_) Fix indentation. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1746878 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/apreq_module_cgi.c b/server/apreq_module_cgi.c index 9efc6ac5947..b7aa8b719eb 100644 --- a/server/apreq_module_cgi.c +++ b/server/apreq_module_cgi.c @@ -261,7 +261,8 @@ static const char *cgi_header_in(apreq_handle_t *handle, apr_pool_t *p = handle->pool; char *key = apr_pstrcat(p, "HTTP_", name, NULL); char *k, *value = NULL; - for (k = key; *k; ++k) { + + for (k = key+5; *k; ++k) { if (*k == '-') *k = '_'; else @@ -269,10 +270,10 @@ static const char *cgi_header_in(apreq_handle_t *handle, } if (!strcmp(key, "HTTP_CONTENT_TYPE") - || !strcmp(key, "HTTP_CONTENT_LENGTH")) - { - key += 5; /* strlen("HTTP_") */ - } + || !strcmp(key, "HTTP_CONTENT_LENGTH")) { + + key += 5; /* strlen("HTTP_") */ + } apr_env_get(&value, key, p); @@ -280,8 +281,6 @@ static const char *cgi_header_in(apreq_handle_t *handle, } - - static void cgi_log_error(const char *file, int line, int level, apr_status_t status, apreq_handle_t *handle, const char *fmt, ...)