Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 77641 invoked from network); 14 Aug 2004 00:11:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Aug 2004 00:11:33 -0000 Received: (qmail 74790 invoked by uid 500); 14 Aug 2004 00:11:27 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 74663 invoked by uid 500); 14 Aug 2004 00:11:26 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 74650 invoked by uid 99); 14 Aug 2004 00:11:26 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [195.154.174.52] (HELO mail.logilune.com) (195.154.174.52) by apache.org (qpsmtpd/0.27.1) with ESMTP; Fri, 13 Aug 2004 17:11:23 -0700 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 8D2BD1E1980 for ; Sat, 14 Aug 2004 02:11:20 +0200 (CEST) Message-ID: <411D58A7.1060607@stason.org> Date: Fri, 13 Aug 2004 17:11:19 -0700 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040708 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: dev@httpd.apache.org Subject: ap_os_escape_path with partial=0? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Can someone please explain what this function does when partial=0? why does it prepend "./" only if the path includes ":/" in it? what's happening here? the API doesn't document this nuance. What kind of input does it take care of? I can see it used by mod_autoindex, but may be it never hits this condition? Shouldn't it go the other way around? i.e. not append ./ if it finds ':/' in the string? if (!(colon && (!slash || colon < slash))) { *d++ = '.'; *d++ = '/'; } Thanks. Here is the whole function for your convenience: AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial) { char *copy = apr_palloc(p, 3 * strlen(path) + 3); const unsigned char *s = (const unsigned char *)path; unsigned char *d = (unsigned char *)copy; unsigned c; if (!partial) { const char *colon = ap_strchr_c(path, ':'); const char *slash = ap_strchr_c(path, '/'); if (colon && (!slash || colon < slash)) { *d++ = '.'; *d++ = '/'; } } while ((c = *s)) { if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) { d = c2x(c, d); } else { *d++ = c; } ++s; } *d = '\0'; return copy; } -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com