From: William A. Rowe Jr Date: Thu, 30 Aug 2001 23:58:23 +0000 (+0000) Subject: The add-in/strip-off temporary trailing slash logic was really hosed X-Git-Tag: 2.0.26~370 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cec5457d721ac38aa168644be7fc45fe23073e3;p=apache The add-in/strip-off temporary trailing slash logic was really hosed in the new (not yet enabled) code path. Now it's slightly hosed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90829 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/request.c b/server/request.c index 321e0a61c9..a74e755f54 100644 --- a/server/request.c +++ b/server/request.c @@ -666,7 +666,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) ap_conf_vector_t **sec_ent = (ap_conf_vector_t **) sconf->sec_dir->elts; int num_sec = sconf->sec_dir->nelts; int sec_idx; - unsigned int seg; + unsigned int seg, startseg; int res; ap_conf_vector_t *entry_config; core_dir_config *entry_core; @@ -728,7 +728,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) * sec_idx keeps track of which section we're on, since sections are * ordered by number of segments. See core_reorder_directories */ - seg = ap_count_dirs(r->filename); + startseg = seg = ap_count_dirs(r->filename); sec_idx = 0; do { int overrides_here; @@ -737,7 +737,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) /* We have no trailing slash, but we sure would appreciate one... */ - if (!sec_idx && r->filename[strlen(r->filename)-1] != '/') + if (sec_idx && r->filename[strlen(r->filename)-1] != '/') strcat(r->filename, "/"); /* Begin *this* level by looking for matching sections @@ -796,7 +796,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) /* That temporary trailing slash was useful, now drop it. */ - if (seg > 1) + if (seg > startseg) r->filename[strlen(r->filename) - 1] = '\0'; /* Time for all good things to come to an end?