From: Ruediger Pluem Date: Mon, 22 May 2006 19:05:09 +0000 (+0000) Subject: * Cleanup the code by replacing some inline code to lower-case a string with X-Git-Tag: 2.3.0~2385 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db02633be560c76050a3ca6ad812bd9c79e0ed48;p=thirdparty%2Fapache%2Fhttpd.git * Cleanup the code by replacing some inline code to lower-case a string with ap_str_tolower. Proposed by: Joe Orton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@408729 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/cache_storage.c b/modules/cache/cache_storage.c index 4d2474eff18..bac7aa21e61 100644 --- a/modules/cache/cache_storage.c +++ b/modules/cache/cache_storage.c @@ -351,10 +351,8 @@ apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p, } else if(r->parsed_uri.hostname) { /* Copy the parsed uri hostname */ - hn = apr_pcalloc(p, strlen(r->parsed_uri.hostname) + 1); - for (i = 0; r->parsed_uri.hostname[i]; i++) { - hn[i] = apr_tolower(r->parsed_uri.hostname[i]); - } + hn = apr_pstrdup(p, r->parsed_uri.hostname); + ap_str_tolower(hn); /* const work-around */ hostname = hn; } @@ -374,10 +372,8 @@ apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p, */ if (r->proxyreq && r->parsed_uri.scheme) { /* Copy the scheme and lower-case it */ - lcs = apr_pcalloc(p, strlen(r->parsed_uri.scheme) + 1); - for (i = 0; r->parsed_uri.scheme[i]; i++) { - lcs[i] = apr_tolower(r->parsed_uri.scheme[i]); - } + lcs = apr_pstrdup(p, r->parsed_uri.scheme); + ap_str_tolower(lcs); /* const work-around */ scheme = lcs; }