httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server util.c
Date Sun, 27 Jan 2002 07:49:05 GMT
wrowe       02/01/26 23:49:05

  Modified:    server   util.c
  Log:
    Whoops - this patch is required by the last request.c change.
  
    Fulfills Brian Pane's suggestion that we always overallocate by one
    to make /foo/bar quickly convertable to /foo/bar/
  
  Revision  Changes    Path
  1.119     +4 -1      httpd-2.0/server/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util.c,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- util.c	3 Dec 2001 00:49:28 -0000	1.118
  +++ util.c	27 Jan 2002 07:49:05 -0000	1.119
  @@ -1703,7 +1703,10 @@
   
       len1 = strlen(src1);
       len2 = strlen(src2);
  -    path = (char *)apr_palloc(a, len1 + len2 + 2); /* +2 for '/' plus null */
  +     /* allocate +3 for '/' delimiter, trailing NULL and overallocate
  +      * one extra byte to allow the caller to add a trailing '/'
  +      */
  +    path = (char *)apr_palloc(a, len1 + len2 + 3);
       if (len1 == 0) {
           *path = '/';
           memcpy(path + 1, src2, len2 + 1);
  
  
  

Mime
View raw message