Fossil SCM
One more: GetFullPathNameW() needs the "\\?\"-prefix as well if the input path is already >MAX_PATH. But we don't want the resulting directory to have this prefix, so strip it off when present.
Commit
e5fef7982deff6bb7cb90194df1a280e4e3f439d
Parent
c952c773ac6b019…
1 file changed
+11
-6
+11
-6
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -36092,15 +36092,11 @@ | ||
| 36092 | 36092 | */ |
| 36093 | 36093 | sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s", |
| 36094 | 36094 | sqlite3_data_directory, winGetDirSep(), zRelative); |
| 36095 | 36095 | return SQLITE_OK; |
| 36096 | 36096 | } |
| 36097 | - if( osIsNT() ){ | |
| 36098 | - zConverted = winUtf8ToUnicode(zRelative); | |
| 36099 | - }else{ | |
| 36100 | - zConverted = sqlite3_win32_utf8_to_mbcs(zRelative); | |
| 36101 | - } | |
| 36097 | + zConverted = winConvertFromUtf8Filename(zRelative); | |
| 36102 | 36098 | if( zConverted==0 ){ |
| 36103 | 36099 | return SQLITE_IOERR_NOMEM; |
| 36104 | 36100 | } |
| 36105 | 36101 | if( osIsNT() ){ |
| 36106 | 36102 | LPWSTR zTemp; |
| @@ -36122,11 +36118,20 @@ | ||
| 36122 | 36118 | sqlite3_free(zTemp); |
| 36123 | 36119 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36124 | 36120 | "winFullPathname2", zRelative); |
| 36125 | 36121 | } |
| 36126 | 36122 | sqlite3_free(zConverted); |
| 36127 | - zOut = winUnicodeToUtf8(zTemp); | |
| 36123 | + if( memcmp(zTemp, L"\\\\?\\", 8)==0 ){ | |
| 36124 | + if( memcmp(zTemp+4, L"UNC\\", 8) ){ | |
| 36125 | + zTemp[6] = '\\'; | |
| 36126 | + zOut = winUnicodeToUtf8(zTemp+6); | |
| 36127 | + }else{ | |
| 36128 | + zOut = winUnicodeToUtf8(zTemp+4); | |
| 36129 | + } | |
| 36130 | + }else{ | |
| 36131 | + zOut = winUnicodeToUtf8(zTemp); | |
| 36132 | + } | |
| 36128 | 36133 | sqlite3_free(zTemp); |
| 36129 | 36134 | } |
| 36130 | 36135 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36131 | 36136 | else{ |
| 36132 | 36137 | char *zTemp; |
| 36133 | 36138 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -36092,15 +36092,11 @@ | |
| 36092 | */ |
| 36093 | sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s", |
| 36094 | sqlite3_data_directory, winGetDirSep(), zRelative); |
| 36095 | return SQLITE_OK; |
| 36096 | } |
| 36097 | if( osIsNT() ){ |
| 36098 | zConverted = winUtf8ToUnicode(zRelative); |
| 36099 | }else{ |
| 36100 | zConverted = sqlite3_win32_utf8_to_mbcs(zRelative); |
| 36101 | } |
| 36102 | if( zConverted==0 ){ |
| 36103 | return SQLITE_IOERR_NOMEM; |
| 36104 | } |
| 36105 | if( osIsNT() ){ |
| 36106 | LPWSTR zTemp; |
| @@ -36122,11 +36118,20 @@ | |
| 36122 | sqlite3_free(zTemp); |
| 36123 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36124 | "winFullPathname2", zRelative); |
| 36125 | } |
| 36126 | sqlite3_free(zConverted); |
| 36127 | zOut = winUnicodeToUtf8(zTemp); |
| 36128 | sqlite3_free(zTemp); |
| 36129 | } |
| 36130 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36131 | else{ |
| 36132 | char *zTemp; |
| 36133 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -36092,15 +36092,11 @@ | |
| 36092 | */ |
| 36093 | sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s", |
| 36094 | sqlite3_data_directory, winGetDirSep(), zRelative); |
| 36095 | return SQLITE_OK; |
| 36096 | } |
| 36097 | zConverted = winConvertFromUtf8Filename(zRelative); |
| 36098 | if( zConverted==0 ){ |
| 36099 | return SQLITE_IOERR_NOMEM; |
| 36100 | } |
| 36101 | if( osIsNT() ){ |
| 36102 | LPWSTR zTemp; |
| @@ -36122,11 +36118,20 @@ | |
| 36118 | sqlite3_free(zTemp); |
| 36119 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36120 | "winFullPathname2", zRelative); |
| 36121 | } |
| 36122 | sqlite3_free(zConverted); |
| 36123 | if( memcmp(zTemp, L"\\\\?\\", 8)==0 ){ |
| 36124 | if( memcmp(zTemp+4, L"UNC\\", 8) ){ |
| 36125 | zTemp[6] = '\\'; |
| 36126 | zOut = winUnicodeToUtf8(zTemp+6); |
| 36127 | }else{ |
| 36128 | zOut = winUnicodeToUtf8(zTemp+4); |
| 36129 | } |
| 36130 | }else{ |
| 36131 | zOut = winUnicodeToUtf8(zTemp); |
| 36132 | } |
| 36133 | sqlite3_free(zTemp); |
| 36134 | } |
| 36135 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36136 | else{ |
| 36137 | char *zTemp; |
| 36138 |