Fossil

Changes On Branch possible-cygwin-fix
Login

Changes On Branch possible-cygwin-fix

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

Changes In Branch possible-cygwin-fix Excluding Merge-Ins

This is equivalent to a diff from 0e822db7 to 13594a12

2013-08-09
18:35
Removed an unused struct member contentCache::skipCnt. ... (check-in: 65f49c99 user: stephan tags: trunk)
04:38
Get capabilities fix et al. ... (check-in: ebafd0c3 user: andybradford tags: ssh-shared-account)
01:09
Fix incorrect wrapping of brief finfo output by simply reducing the size of the buffer passed to comment_print(). ... (Closed-Leaf check-in: bdbf144e user: andybradford tags: pending-review)
2013-08-08
21:32
merge trunk. Adapt patch to latest SQLite changes (the MAX_PATH fix in os_win.c) ... (Closed-Leaf check-in: 13594a12 user: jan.nijtmans tags: possible-cygwin-fix)
18:57
Merge with trunk. ... (Closed-Leaf check-in: 9a023e0d user: isaac.jurado tags: git-better-import)
14:00
Merge the fork in trunk. ... (check-in: 0e822db7 user: drh tags: trunk)
08:42
Fixed /reports menu buttons broken by renaming of the link. Removed a target=... from one of the /reports hrefs, for consistency. ... (check-in: 00630581 user: stephan tags: trunk)
2013-08-06
14:33
When resetting capabilities, make sure that "anonymous" and "nobody" can be reapplied afterwards. ... (check-in: b1ffbfa4 user: drh tags: trunk)
2013-08-02
09:42
merge trunk ... (check-in: 863068e0 user: jan.nijtmans tags: possible-cygwin-fix)

Changes to src/sqlite3.c.

31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
  { "GetTempPathA",            (SYSCALL)GetTempPathA,            0 },
#else
  { "GetTempPathA",            (SYSCALL)0,                       0 },
#endif

#define osGetTempPathA ((DWORD(WINAPI*)(DWORD,LPSTR))aSyscall[31].pCurrent)

#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
  { "GetTempPathW",            (SYSCALL)GetTempPathW,            0 },
#else
  { "GetTempPathW",            (SYSCALL)0,                       0 },
#endif

#define osGetTempPathW ((DWORD(WINAPI*)(DWORD,LPWSTR))aSyscall[32].pCurrent)








|







31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
  { "GetTempPathA",            (SYSCALL)GetTempPathA,            0 },
#else
  { "GetTempPathA",            (SYSCALL)0,                       0 },
#endif

#define osGetTempPathA ((DWORD(WINAPI*)(DWORD,LPSTR))aSyscall[31].pCurrent)

#if !SQLITE_OS_WINRT && !defined(__CYGWIN__) && defined(SQLITE_WIN32_HAS_WIDE)
  { "GetTempPathW",            (SYSCALL)GetTempPathW,            0 },
#else
  { "GetTempPathW",            (SYSCALL)0,                       0 },
#endif

#define osGetTempPathW ((DWORD(WINAPI*)(DWORD,LPWSTR))aSyscall[32].pCurrent)

34562
34563
34564
34565
34566
34567
34568


34569
34570
34571
34572
34573
34574
34575
** in characters, so we allocate 3 bytes per character assuming worst-case
** 3-bytes-per-character UTF8.
*/
#ifndef SQLITE_WIN32_MAX_PATH
#  define SQLITE_WIN32_MAX_PATH   (MAX_PATH*3)
#endif



/*
** Create a temporary file name in zBuf.  zBuf must be big enough to
** hold at pVfs->mxPathname characters.
*/
static int getTempname(int nBuf, char *zBuf){
  static char zChars[] =
    "abcdefghijklmnopqrstuvwxyz"







>
>







34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
34577
** in characters, so we allocate 3 bytes per character assuming worst-case
** 3-bytes-per-character UTF8.
*/
#ifndef SQLITE_WIN32_MAX_PATH
#  define SQLITE_WIN32_MAX_PATH   (MAX_PATH*3)
#endif

static int winIsDir(const void *zConverted);

/*
** Create a temporary file name in zBuf.  zBuf must be big enough to
** hold at pVfs->mxPathname characters.
*/
static int getTempname(int nBuf, char *zBuf){
  static char zChars[] =
    "abcdefghijklmnopqrstuvwxyz"
34585
34586
34587
34588
34589
34590
34591









































34592
34593
34594
34595
34596
34597
34598
34599
  */
  SimulateIOError( return SQLITE_IOERR );

  if( sqlite3_temp_directory ){
    sqlite3_snprintf(SQLITE_WIN32_MAX_PATH-30, zTempPath, "%s",
                     sqlite3_temp_directory);
  }









































#if !SQLITE_OS_WINRT
  else if( isNT() ){
    char *zMulti;
    WCHAR zWidePath[MAX_PATH];
    if( osGetTempPathW(MAX_PATH-30, zWidePath)==0 ){
      OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_GETTEMPPATH\n"));
      return SQLITE_IOERR_GETTEMPPATH;
    }







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







34587
34588
34589
34590
34591
34592
34593
34594
34595
34596
34597
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
34613
34614
34615
34616
34617
34618
34619
34620
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
34636
34637
34638
34639
34640
34641
34642
  */
  SimulateIOError( return SQLITE_IOERR );

  if( sqlite3_temp_directory ){
    sqlite3_snprintf(SQLITE_WIN32_MAX_PATH-30, zTempPath, "%s",
                     sqlite3_temp_directory);
  }
#if defined(__CYGWIN__)
  else{
    static const char *azDirs[] = {
       0,
       0,
       0,
       0,
       "/var/tmp",
       "/usr/tmp",
       "/tmp",
       "."
    };
    const char *zDir;
    WCHAR zWidePath[MAX_PATH];

    if( !azDirs[0] ) azDirs[0] = getenv("TMPDIR");
    if( !azDirs[1] ) azDirs[1] = getenv("TMP");
    if( !azDirs[2] ) azDirs[2] = getenv("TEMP");
    if( !azDirs[3] ) azDirs[3] = getenv("USERPROFILE");
    for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
      zDir = azDirs[i];
      if( zDir==0 || zDir[0]==0 ) continue;
      if( zDir[1]!=':' ){
        cygwin_conv_path(CCP_POSIX_TO_WIN_W, zDir, zWidePath, MAX_PATH);
        zDir = azDirs[i] = unicodeToUtf8(zWidePath);
        if( zDir==0 ){
          OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_NOMEM\n"));
          return SQLITE_IOERR_NOMEM;
        }
      }else{
        /* Convert the filename to the system encoding. */
        osMultiByteToWideChar(CP_UTF8, 0, zDir, -1, zWidePath,
                                      MAX_PATH);
      }
      if( winIsDir(zWidePath) ){
        break;
      }
      azDirs[i] = ""; /* Don't retry in future call */
    }
    sqlite3_snprintf(SQLITE_WIN32_MAX_PATH-30, zTempPath, "%s", zDir);
  }
#elif !SQLITE_OS_WINRT
  else if( isNT() ){
    char *zMulti;
    WCHAR zWidePath[MAX_PATH];
    if( osGetTempPathW(MAX_PATH-30, zWidePath)==0 ){
      OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_GETTEMPPATH\n"));
      return SQLITE_IOERR_GETTEMPPATH;
    }