httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/file_io/win32 open.c
Date Fri, 10 Nov 2000 21:49:20 GMT
wrowe       00/11/10 13:49:20

  Modified:    src/lib/apr/file_io/win32 open.c
  Log:
    Reintroduce MAX_PATH into win32 Unicode path processing, except on the
    local drives using //?/d:/ semantics.
  
  Revision  Changes    Path
  1.58      +9 -2      apache-2.0/src/lib/apr/file_io/win32/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/open.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- open.c	2000/11/09 21:05:15	1.57
  +++ open.c	2000/11/10 21:49:19	1.58
  @@ -81,11 +81,18 @@
        */
       int srcremains = strlen(srcstr) + 1;
       int retremains = srcremains + 4;
  -    apr_wchar_t *retstr = apr_palloc(p, retremains * 2), *t = retstr;
  +    apr_wchar_t *retstr, *t;
       if (srcstr[1] == ':' && srcstr[2] == '/') {
  +        retstr = apr_palloc(p, retremains * 2);
           wcscpy (retstr, L"\\\\?\\");
           retremains -= 4;
  -        t += 4;
  +        t = retstr + 4;
  +    }
  +    else /* Short path: count the trailing NULL */
  +    {
  +        if (retremains > MAX_PATH)
  +            retremains = MAX_PATH;
  +        t = retstr = apr_palloc(p, retremains * 2);
       }
       if (conv_utf8_to_ucs2(srcstr, &srcremains,
                             t, &retremains) || srcremains)
  
  
  

Mime
View raw message