You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@hyperreal.org on 1998/10/01 06:14:43 UTC

cvs commit: apache-1.3/src/main http_request.c

coar        98/09/30 21:14:43

  Modified:    src/main http_request.c
  Log:
  	ap_sub_req_lookup_file() was assuming that all absolute paths
  	begin with "/" -- which obviously isn't the case for Win32.
  	#ifdef this to do the right thing on Win32.  (It's unclear
  	whether a leading "/" should still be considered a valid absolute
  	path for Win32, since it's thereby inheriting the current
  	drive.  At least most of the hole is closed.)
  
  PR:		2976, 3074
  Submitted by:	Ken Parzygnat <kp...@raleigh.ibm.com>
  Reviewed by:	Ken Coar
  
  Revision  Changes    Path
  1.131     +11 -2     apache-1.3/src/main/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/main/http_request.c,v
  retrieving revision 1.130
  retrieving revision 1.131
  diff -u -r1.130 -r1.131
  --- http_request.c	1998/08/11 00:09:46	1.130
  +++ http_request.c	1998/10/01 04:14:42	1.131
  @@ -188,8 +188,10 @@
       }
   
   #ifdef WIN32
  -    /* If the path is x:/, then convert it to x:/., coz that's what stat needs to work properly */
  -    if(strlen(path) == 3 && path[1] == ':') {
  +    /* If the path is x:/, then convert it to x:/., coz that's what stat
  +     * needs to work properly
  +     */
  +    if (strlen(path) == 3 && path[1] == ':') {
   	strcpy(buf,path);
   	buf[3]='.';
   	buf[4]='\0';
  @@ -826,7 +828,14 @@
            * file may not have a uri associated with it -djg
            */
           rnew->uri = "INTERNALLY GENERATED file-relative req";
  +#ifdef WIN32
  +        rnew->filename = ((new_file[0] == '/'
  +                           || (ap_isalpha(new_file[0])
  +                               && new_file[1] == ':'
  +                               && new_file[2] == '/')) ?
  +#else
           rnew->filename = ((new_file[0] == '/') ?
  +#endif
                             ap_pstrdup(rnew->pool, new_file) :
                             ap_make_full_path(rnew->pool, fdir, new_file));
           rnew->per_dir_config = r->server->lookup_defaults;