Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 29642 invoked by uid 500); 11 Oct 2001 13:53:35 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 29609 invoked from network); 11 Oct 2001 13:53:34 -0000 Date: 11 Oct 2001 13:48:59 -0000 Message-ID: <20011011134859.23615.qmail@icarus.apache.org> From: wrowe@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/file_io/win32 filesys.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N wrowe 01/10/11 06:48:59 Modified: file_io/win32 filesys.c Log: More path parsing corrections, Win32 path code should now be stable. Revision Changes Path 1.4 +12 -14 apr/file_io/win32/filesys.c Index: filesys.c =================================================================== RCS file: /home/cvs/apr/file_io/win32/filesys.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- filesys.c 2001/09/09 06:03:05 1.3 +++ filesys.c 2001/10/11 13:48:59 1.4 @@ -170,23 +170,21 @@ apr_wchar_t *ignored; apr_wchar_t wpath[APR_PATH_MAX]; apr_status_t rv; + apr_wchar_t wroot[APR_PATH_MAX]; /* ???: This needs review, apparently "\\?\d:." returns "\\?\d:" * as if that is useful for anything. */ - { - apr_wchar_t wroot[APR_PATH_MAX]; - if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) - / sizeof(apr_wchar_t), root)) - return rv; - if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) - return apr_get_os_error(); - } - { - char path[APR_PATH_MAX]; - if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath))) - return rv; - *rootpath = apr_pstrdup(p, path); - } + if (rv = utf8_to_unicode_path(wroot, sizeof(wroot) + / sizeof(apr_wchar_t), root)) + return rv; + if (!GetFullPathNameW(wroot, sizeof(wpath) / sizeof(apr_wchar_t), wpath, &ignored)) + return apr_get_os_error(); + + /* Borrow wroot as a char buffer (twice as big as necessary) + */ + if ((rv = unicode_to_utf8_path((char*)wroot, sizeof(wroot), wpath))) + return rv; + *rootpath = apr_pstrdup(p, (char*)wroot); } else #endif