Fossil

Check-in [e5fef798]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | win32-longpath
Files: files | file ages | folders
SHA1:e5fef7982deff6bb7cb90194df1a280e4e3f439d
User & Date: jan.nijtmans 2013-12-12 16:13:54
Context
2013-12-13
13:53
merge trunk check-in: 46e1d4c8 user: jan.nijtmans tags: win32-longpath
2013-12-12
16:13
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. check-in: e5fef798 user: jan.nijtmans tags: win32-longpath
15:01
Final bug-fix: Before prefixing a path with "\\?\", check if it is prefixed already. If so, don't do it again. Everything seems to work fine now! check-in: c952c773 user: jan.nijtmans tags: win32-longpath
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/sqlite3.c.

36090
36091
36092
36093
36094
36095
36096
36097
36098
36099
36100
36101
36102
36103
36104
36105
36106
36107
36108
.....
36120
36121
36122
36123
36124
36125
36126








36127

36128
36129
36130
36131
36132
36133
36134
    **       for converting the relative path name to an absolute
    **       one by prepending the data directory and a backslash.
    */
    sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s",
                     sqlite3_data_directory, winGetDirSep(), zRelative);
    return SQLITE_OK;
  }
  if( osIsNT() ){
    zConverted = winUtf8ToUnicode(zRelative);
  }else{
    zConverted = sqlite3_win32_utf8_to_mbcs(zRelative);
  }
  if( zConverted==0 ){
    return SQLITE_IOERR_NOMEM;
  }
  if( osIsNT() ){
    LPWSTR zTemp;
    nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
    if( nByte==0 ){
................................................................................
    if( nByte==0 ){
      sqlite3_free(zConverted);
      sqlite3_free(zTemp);
      return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(),
                         "winFullPathname2", zRelative);
    }
    sqlite3_free(zConverted);








    zOut = winUnicodeToUtf8(zTemp);

    sqlite3_free(zTemp);
  }
#ifdef SQLITE_WIN32_HAS_ANSI
  else{
    char *zTemp;
    nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
    if( nByte==0 ){







|
<
<
<
<







 







>
>
>
>
>
>
>
>
|
>







36090
36091
36092
36093
36094
36095
36096
36097




36098
36099
36100
36101
36102
36103
36104
.....
36116
36117
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
36134
36135
36136
36137
36138
36139
    **       for converting the relative path name to an absolute
    **       one by prepending the data directory and a backslash.
    */
    sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s",
                     sqlite3_data_directory, winGetDirSep(), zRelative);
    return SQLITE_OK;
  }
  zConverted = winConvertFromUtf8Filename(zRelative);




  if( zConverted==0 ){
    return SQLITE_IOERR_NOMEM;
  }
  if( osIsNT() ){
    LPWSTR zTemp;
    nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
    if( nByte==0 ){
................................................................................
    if( nByte==0 ){
      sqlite3_free(zConverted);
      sqlite3_free(zTemp);
      return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(),
                         "winFullPathname2", zRelative);
    }
    sqlite3_free(zConverted);
    if( memcmp(zTemp, L"\\\\?\\", 8)==0 ){
      if( memcmp(zTemp+4, L"UNC\\", 8) ){
        zTemp[6] = '\\';
        zOut = winUnicodeToUtf8(zTemp+6);
      }else{
        zOut = winUnicodeToUtf8(zTemp+4);
      }
    }else{
      zOut = winUnicodeToUtf8(zTemp);
    }
    sqlite3_free(zTemp);
  }
#ifdef SQLITE_WIN32_HAS_ANSI
  else{
    char *zTemp;
    nByte = osGetFullPathNameA((char*)zConverted, 0, 0, 0);
    if( nByte==0 ){