Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 86409 invoked by uid 500); 15 Mar 2002 16:39:37 -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 86396 invoked from network); 15 Mar 2002 16:39:37 -0000 Date: Fri, 15 Mar 2002 11:37:54 -0500 (EST) From: Cliff Woolley X-X-Sender: root@deepthought.cs.virginia.edu To: Jeff Trawick cc: dev@httpd.apache.org Subject: Re: cvs commit: httpd-2.0/server request.c In-Reply-To: <20020315133542.18907.qmail@icarus.apache.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On 15 Mar 2002 trawick@apache.org wrote: > Index: request.c > =================================================================== > RCS file: /home/cvs/httpd-2.0/server/request.c,v > retrieving revision 1.106 > retrieving revision 1.107 > diff -u -r1.106 -r1.107 > --- request.c 13 Mar 2002 20:48:00 -0000 1.106 > +++ request.c 15 Mar 2002 13:35:42 -0000 1.107 > @@ -556,6 +556,20 @@ > */ > if (!r->finfo.filetype || r->finfo.filetype == APR_LNK) { > apr_stat(&r->finfo, r->filename, APR_FINFO_MIN, r->pool); > + > + /* some OSs will return APR_SUCCESS/APR_REG if we stat > + * a regular file but we have '/' at the end of the name; > + * > + * other OSs will return APR_ENOTDIR for that situation; > + * > + * handle it the same everywhere by simulating a failure > + * if it looks like a directory but really isn't > + */ > + if (r->finfo.filetype && > + r->finfo.filetype != APR_DIR && > + r->filename[strlen(r->filename) - 1] == '/') { > + r->finfo.filetype = 0; /* forget what we learned */ > + } > } It would seem to me that this should go in apr_stat, rather than in request.c, in order to make the semantics of apr_stat consistent across platforms. No? --Cliff -------------------------------------------------------------- Cliff Woolley cliffwoolley@yahoo.com Charlottesville, VA