From: Benno Rice Date: Fri, 29 Aug 2008 04:35:42 +0000 (+1000) Subject: Whitespace fixage. X-Git-Tag: SQUID_3_1_0_1~49^2~62^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3900427d5afa992f1accd3935bc52cec0f1ce63;p=thirdparty%2Fsquid.git Whitespace fixage. --- diff --git a/src/url.cc b/src/url.cc index 8cdf775cdf..a066e06835 100644 --- a/src/url.cc +++ b/src/url.cc @@ -535,62 +535,61 @@ urlCanonicalClean(const HttpRequest * request) const char * urlAbsolute(const HttpRequest * req, const char *relUrl) { - LOCAL_ARRAY(char, portbuf, 32); - LOCAL_ARRAY(char, urlbuf, MAX_URL); + char portbuf[32], urlbuf[MAX_URL]; char *path, *last_slash; if (relUrl == NULL) { - return (NULL); + return (NULL); } if (req->method.id() == METHOD_CONNECT) { - return (NULL); + return (NULL); } if (strchr(relUrl, ':') != NULL) { - return (NULL); + return (NULL); } if (req->protocol == PROTO_URN) { - snprintf(urlbuf, MAX_URL, "urn:%s", req->urlpath.buf()); + snprintf(urlbuf, MAX_URL, "urn:%s", req->urlpath.buf()); } else { - portbuf[0] = '\0'; - if (req->port != urlDefaultPort(req->protocol)) { - snprintf(portbuf, 32, ":%d", req->port); - } - if (relUrl[0] == '/') { - snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s", - ProtocolStr[req->protocol], - req->login, - *req->login ? "@" : null_string, - req->GetHost(), - portbuf, - relUrl - ); - } else { - path = xstrdup(req->urlpath.buf()); - last_slash = strrchr(path, '/'); - if (last_slash == NULL) { - snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s/%s", - ProtocolStr[req->protocol], - req->login, - *req->login ? "@" : null_string, - req->GetHost(), - portbuf, - relUrl - ); - } else { - last_slash++; - *last_slash = '\0'; - snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s%s", - ProtocolStr[req->protocol], - req->login, - *req->login ? "@" : null_string, - req->GetHost(), - portbuf, - path, - relUrl - ); - } - xfree(path); - } + portbuf[0] = '\0'; + if (req->port != urlDefaultPort(req->protocol)) { + snprintf(portbuf, 32, ":%d", req->port); + } + if (relUrl[0] == '/') { + snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s", + ProtocolStr[req->protocol], + req->login, + *req->login ? "@" : null_string, + req->GetHost(), + portbuf, + relUrl + ); + } else { + path = xstrdup(req->urlpath.buf()); + last_slash = strrchr(path, '/'); + if (last_slash == NULL) { + snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s/%s", + ProtocolStr[req->protocol], + req->login, + *req->login ? "@" : null_string, + req->GetHost(), + portbuf, + relUrl + ); + } else { + last_slash++; + *last_slash = '\0'; + snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s%s%s", + ProtocolStr[req->protocol], + req->login, + *req->login ? "@" : null_string, + req->GetHost(), + portbuf, + path, + relUrl + ); + } + xfree(path); + } } return (xstrdup(urlbuf));