/ Check-in [e404ad70]
Login

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

Overview
Comment:In winFullPathname, translate '/X:' to 'X:' before doing anything else.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e404ad705d0e2d96025d05cc88348ffcd0703533
User & Date: mistachkin 2016-06-06 20:36:26
Context
2016-06-07
20:25
Fix the walcrash4.test test module so that it works on windows. check-in: 2091a4c9 user: drh tags: trunk
2016-06-06
20:36
In winFullPathname, translate '/X:' to 'X:' before doing anything else. check-in: e404ad70 user: mistachkin tags: trunk
20:27
Translate filenames of the form "/c:/*" into just "c:/*" on WinRT and Cygwin. (SQLite has long done this for Win32/WinNT.) check-in: f8470ffc user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  5265   5265   */
  5266   5266   static int winFullPathname(
  5267   5267     sqlite3_vfs *pVfs,            /* Pointer to vfs object */
  5268   5268     const char *zRelative,        /* Possibly relative input path */
  5269   5269     int nFull,                    /* Size of output buffer in bytes */
  5270   5270     char *zFull                   /* Output buffer */
  5271   5271   ){
         5272  +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(__CYGWIN__)
         5273  +  DWORD nByte;
         5274  +  void *zConverted;
         5275  +  char *zOut;
         5276  +#endif
  5272   5277   
  5273         -#if defined(__CYGWIN__)
  5274         -  SimulateIOError( return SQLITE_ERROR );
  5275         -  UNUSED_PARAMETER(nFull);
  5276         -  assert( nFull>=pVfs->mxPathname );
  5277   5278     /* If this path name begins with "/X:", where "X" is any alphabetic
  5278   5279     ** character, discard the initial "/" from the pathname.
  5279   5280     */
  5280   5281     if( zRelative[0]=='/' && winIsDriveLetterAndColon(zRelative+1) ){
  5281   5282       zRelative++;
  5282   5283     }
  5283   5284   
         5285  +#if defined(__CYGWIN__)
         5286  +  SimulateIOError( return SQLITE_ERROR );
         5287  +  UNUSED_PARAMETER(nFull);
         5288  +  assert( nFull>=pVfs->mxPathname );
  5284   5289     if ( sqlite3_data_directory && !winIsVerbatimPathname(zRelative) ){
  5285   5290       /*
  5286   5291       ** NOTE: We are dealing with a relative path name and the data
  5287   5292       **       directory has been set.  Therefore, use it as the basis
  5288   5293       **       for converting the relative path name to an absolute
  5289   5294       **       one by prepending the data directory and a slash.
  5290   5295       */
................................................................................
  5332   5337       }
  5333   5338     }
  5334   5339     return SQLITE_OK;
  5335   5340   #endif
  5336   5341   
  5337   5342   #if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && !defined(__CYGWIN__)
  5338   5343     SimulateIOError( return SQLITE_ERROR );
  5339         -  /* If this path name begins with "/X:", where "X" is any alphabetic
  5340         -  ** character, discard the initial "/" from the pathname.
  5341         -  */
  5342         -  if( zRelative[0]=='/' && winIsDriveLetterAndColon(zRelative+1) ){
  5343         -    zRelative++;
  5344         -  }
  5345         -
  5346   5344     /* WinCE has no concept of a relative pathname, or so I am told. */
  5347   5345     /* WinRT has no way to convert a relative path to an absolute one. */
  5348   5346     if ( sqlite3_data_directory && !winIsVerbatimPathname(zRelative) ){
  5349   5347       /*
  5350   5348       ** NOTE: We are dealing with a relative path name and the data
  5351   5349       **       directory has been set.  Therefore, use it as the basis
  5352   5350       **       for converting the relative path name to an absolute
................................................................................
  5357   5355     }else{
  5358   5356       sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zRelative);
  5359   5357     }
  5360   5358     return SQLITE_OK;
  5361   5359   #endif
  5362   5360   
  5363   5361   #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(__CYGWIN__)
  5364         -  DWORD nByte;
  5365         -  void *zConverted;
  5366         -  char *zOut;
  5367         -
  5368         -  /* If this path name begins with "/X:", where "X" is any alphabetic
  5369         -  ** character, discard the initial "/" from the pathname.
  5370         -  */
  5371         -  if( zRelative[0]=='/' && winIsDriveLetterAndColon(zRelative+1) ){
  5372         -    zRelative++;
  5373         -  }
  5374         -
  5375   5362     /* It's odd to simulate an io-error here, but really this is just
  5376   5363     ** using the io-error infrastructure to test that SQLite handles this
  5377   5364     ** function failing. This function could fail if, for example, the
  5378   5365     ** current working directory has been unlinked.
  5379   5366     */
  5380   5367     SimulateIOError( return SQLITE_ERROR );
  5381   5368     if ( sqlite3_data_directory && !winIsVerbatimPathname(zRelative) ){