You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2008/05/06 17:18:39 UTC
svn commit: r653807 - /apr/apr/branches/1.2.x/file_io/win32/open.c
Author: wrowe
Date: Tue May 6 08:18:38 2008
New Revision: 653807
URL: http://svn.apache.org/viewvc?rev=653807&view=rev
Log:
Reduce the point at which we use long filename manipulation to 248
characters, as "path names" are further constrained to 248 rather
than MAX_PATH chars.
Submitted by: Stefan <steveking gmx.ch>
Backports: 653805
Modified:
apr/apr/branches/1.2.x/file_io/win32/open.c
Modified: apr/apr/branches/1.2.x/file_io/win32/open.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/file_io/win32/open.c?rev=653807&r1=653806&r2=653807&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/file_io/win32/open.c (original)
+++ apr/apr/branches/1.2.x/file_io/win32/open.c Tue May 6 08:18:38 2008
@@ -54,17 +54,20 @@
apr_status_t rv;
/* This is correct, we don't twist the filename if it is will
- * definately be shorter than MAX_PATH. It merits some
+ * definately be shorter than 248 characters. It merits some
* performance testing to see if this has any effect, but there
* seem to be applications that get confused by the resulting
* Unicode \\?\ style file names, especially if they use argv[0]
* or call the Win32 API functions such as GetModuleName, etc.
* Not every application is prepared to handle such names.
+ *
+ * Note also this is shorter than MAX_PATH, as directory paths
+ * are actually limited to 248 characters.
*
* Note that a utf-8 name can never result in more wide chars
* than the original number of utf-8 narrow chars.
*/
- if (srcremains > MAX_PATH) {
+ if (srcremains > 248) {
if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) {
wcscpy (retstr, L"\\\\?\\");
retlen -= 4;