Author: wrowe Date: Tue May 6 08:18:55 2008 New Revision: 653808 URL: http://svn.apache.org/viewvc?rev=653808&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 Backports: 653805 Modified: apr/apr/branches/0.9.x/file_io/win32/open.c Modified: apr/apr/branches/0.9.x/file_io/win32/open.c URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/file_io/win32/open.c?rev=653808&r1=653807&r2=653808&view=diff ============================================================================== --- apr/apr/branches/0.9.x/file_io/win32/open.c (original) +++ apr/apr/branches/0.9.x/file_io/win32/open.c Tue May 6 08:18:55 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;