SQLite

Check-in [c4eb2100c3]
Login

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

Overview
Comment:Work around win2k problems so that single-character filenames can be used. Ticket #2151. (CVS 3582)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c4eb2100c39356e1816cc6514d65155e47ea1a1d
User & Date: drh 2007-01-09 15:32:18.000
Context
2007-01-09
17:18
Fix the windows OS layer so that it returns detailed IOERR error codes. (CVS 3583) (check-in: 4b36de46c4 user: drh tags: trunk)
15:32
Work around win2k problems so that single-character filenames can be used. Ticket #2151. (CVS 3582) (check-in: c4eb2100c3 user: drh tags: trunk)
15:06
Documentation and tests to show that the cause of a parsing error is available on sqlite3_errmsg after sqlite3_step return SQLITE_SCHEMA. (CVS 3581) (check-in: 31a661d424 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_win.c.
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
  /* WinCE has no concept of a relative pathname, or so I am told. */
  zFull = sqliteStrDup(zRelative);
#else
  int nByte;
  void *zConverted;
  zConverted = convertUtf8Filename(zRelative);
  if( isNT() ){
    WCHAR *zTemp, *zNotUsedW;
    nByte = GetFullPathNameW((WCHAR*)zConverted, 0, 0, &zNotUsedW) + 1;
    zTemp = sqliteMalloc( nByte*sizeof(zTemp[0]) );
    if( zTemp==0 ){
      sqliteFree(zConverted);
      return 0;
    }
    GetFullPathNameW((WCHAR*)zConverted, nByte, zTemp, &zNotUsedW);
    sqliteFree(zConverted);
    zFull = unicodeToUtf8(zTemp);
    sqliteFree(zTemp);
  }else{
    char *zTemp, *zNotUsed;
    nByte = GetFullPathNameA((char*)zConverted, 0, 0, &zNotUsed) + 1;
    zTemp = sqliteMalloc( nByte*sizeof(zTemp[0]) );
    if( zTemp==0 ){
      sqliteFree(zConverted);
      return 0;
    }
    GetFullPathNameA((char*)zConverted, nByte, zTemp, &zNotUsed);
    sqliteFree(zConverted);
    zFull = mbcsToUtf8(zTemp);
    sqliteFree(zTemp);
  }
#endif
  return zFull;
}







|
|





|




|
|





|







1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
  /* WinCE has no concept of a relative pathname, or so I am told. */
  zFull = sqliteStrDup(zRelative);
#else
  int nByte;
  void *zConverted;
  zConverted = convertUtf8Filename(zRelative);
  if( isNT() ){
    WCHAR *zTemp;
    nByte = GetFullPathNameW((WCHAR*)zConverted, 0, 0, 0) + 3;
    zTemp = sqliteMalloc( nByte*sizeof(zTemp[0]) );
    if( zTemp==0 ){
      sqliteFree(zConverted);
      return 0;
    }
    GetFullPathNameW((WCHAR*)zConverted, nByte, zTemp, 0);
    sqliteFree(zConverted);
    zFull = unicodeToUtf8(zTemp);
    sqliteFree(zTemp);
  }else{
    char *zTemp;
    nByte = GetFullPathNameA((char*)zConverted, 0, 0, 0) + 3;
    zTemp = sqliteMalloc( nByte*sizeof(zTemp[0]) );
    if( zTemp==0 ){
      sqliteFree(zConverted);
      return 0;
    }
    GetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
    sqliteFree(zConverted);
    zFull = mbcsToUtf8(zTemp);
    sqliteFree(zTemp);
  }
#endif
  return zFull;
}