You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Paul Sutton <pc...@hyperreal.org> on 1997/09/12 10:54:43 UTC
cvs commit: apachen/src/os/win32 os.c
pcs 97/09/12 01:54:42
Modified: src/os/win32 os.c
Log:
Update os_is_path_absolute() on win32. The check performed is the same
as Apache already does in the code.
Revision Changes Path
1.2 +6 -4 apachen/src/os/win32/os.c
Index: os.c
===================================================================
RCS file: /export/home/cvs/apachen/src/os/win32/os.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- os.c 1997/09/12 08:03:50 1.1
+++ os.c 1997/09/12 08:54:42 1.2
@@ -1,11 +1,13 @@
/*
- * This file will include OS specific functions which are not inlineable.
- * Any inlineable functions should be defined in os-inline.c instead.
+ * OS abstraction functions
*/
#include "os.h"
-API_EXPORT(int)ap_is_path_absolute(char *file)
+API_EXPORT(int)os_is_path_absolute(char *file)
{
- return (file && file[0] == '/' ? 1 : 0);
+ /* For now, just do the same check that http_request.c and mod_alias.c
+ * do.
+ */
+ return (file && (file[0] == '/' || file[1] == ':') ? 1 : 0);
}
Re: cvs commit: apachen/src/os/win32 os.c
Posted by Paul Sutton <pa...@ukweb.com>.
On Fri, 12 Sep 1997, Ben Laurie wrote:
> Paul Sutton wrote:
> > On Fri, 12 Sep 1997, Ben Laurie wrote:
> > > Paul Sutton wrote:
> > > > + return (file && (file[0] == '/' || file[1] == ':') ? 1 : 0);
> > > What? What's wrong with:
> > > return file && (file[0] == '/' || file[1] == ':');
> >
> > Eh? They are almost exactly the same. If ?: is too expense change it to
> > the latter.
> No, they are _exactly_ the same (except yours is harder to read), which
> is why I object.
Yeah. I wasn't clear.. I say +1 if you want to change it. I was
concentrating on getting the infrastructure in place to suport OS
abstractions - the actual example of os_is_path_absolute() I threw in at
the last moment. Because it is wrong (no check for UNCs, thinks relative
paths like "C:relative/bit" are absolute) I didn't really think about it
too much, assuming it would need fixing properly pretty soon. I also
wanted to get the OS abstraction-enabling patches committed asap so we
have as long as possible to test them before the planned beta release, and
before a feature freeze is firmly applied.
//pcs
Re: cvs commit: apachen/src/os/win32 os.c
Posted by Ben Laurie <be...@algroup.co.uk>.
Paul Sutton wrote:
>
> On Fri, 12 Sep 1997, Ben Laurie wrote:
> > Paul Sutton wrote:
> > > + return (file && (file[0] == '/' || file[1] == ':') ? 1 : 0);
> >
> > What? What's wrong with:
> >
> > return file && (file[0] == '/' || file[1] == ':');
>
> Eh? They are almost exactly the same. If ?: is too expense change it to
> the latter.
No, they are _exactly_ the same (except yours is harder to read), which
is why I object.
Cheers,
Ben.
--
Ben Laurie |Phone: +44 (181) 994 6435|Apache Group member
Freelance Consultant |Fax: +44 (181) 994 6472|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd, |http://www.algroup.co.uk/Apache-SSL
London, England. |"Apache: TDG" http://www.ora.com/catalog/apache
Re: cvs commit: apachen/src/os/win32 os.c
Posted by Paul Sutton <pa...@ukweb.com>.
On Fri, 12 Sep 1997, Ben Laurie wrote:
> Paul Sutton wrote:
> > + return (file && (file[0] == '/' || file[1] == ':') ? 1 : 0);
>
> What? What's wrong with:
>
> return file && (file[0] == '/' || file[1] == ':');
Eh? They are almost exactly the same. If ?: is too expense change it to
the latter.
//pcs
Re: cvs commit: apachen/src/os/win32 os.c
Posted by Ben Laurie <be...@algroup.co.uk>.
Paul Sutton wrote:
> + return (file && (file[0] == '/' || file[1] == ':') ? 1 : 0);
What? What's wrong with:
return file && (file[0] == '/' || file[1] == ':');
???
Cheers,
Ben.
--
Ben Laurie |Phone: +44 (181) 994 6435|Apache Group member
Freelance Consultant |Fax: +44 (181) 994 6472|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd, |http://www.algroup.co.uk/Apache-SSL
London, England. |"Apache: TDG" http://www.ora.com/catalog/apache