From: William A. Rowe Jr Date: Tue, 16 Oct 2001 23:49:25 +0000 (+0000) Subject: Already committed in similar form to Apache 1.3.22-dev, this patch allows X-Git-Tag: 2.0.27~113 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2015a903703430d0eef01a4a72a55aec56f2134a;p=thirdparty%2Fapache%2Fhttpd.git Already committed in similar form to Apache 1.3.22-dev, this patch allows Win32/OS2/Netware paths to work with mod_vhost_alias. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91515 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_vhost_alias.c b/modules/mappers/mod_vhost_alias.c index 12ad0ddcd67..00b4e208f10 100644 --- a/modules/mappers/mod_vhost_alias.c +++ b/modules/mappers/mod_vhost_alias.c @@ -193,9 +193,9 @@ static const char *vhost_alias_set(cmd_parms *cmd, void *dummy, const char *map) return "INTERNAL ERROR: unknown command info"; } - if (*map != '/') { + if (!ap_os_is_path_absolute(cmd->pool, map)) { if (strcasecmp(map, "none")) { - return "format string must start with '/' or be 'none'"; + return "format string must be an absolute path, or 'none'"; } *pmap = NULL; *pmode = VHOST_ALIAS_NONE; @@ -413,6 +413,7 @@ static void vhost_alias_interpolate(request_rec *r, const char *name, if (last == '/') { ++uri; } + if (r->filename) { r->filename = apr_pstrcat(r->pool, r->filename, buf, uri, NULL); } @@ -461,6 +462,12 @@ static int mva_translate(request_rec *r) return DECLINED; } + /* ### There is an optimization available here to determine the + * absolute portion of the path from the server config phase, + * through the first % segment, and note that portion of the path + * canonical_path buffer. + */ + r->canonical_filename = ""; vhost_alias_interpolate(r, name, map, uri); if (cgi) {