/ Check-in [cc210517]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Change OS/2 version of sqlite3Os2FullPathname() for cross-compiler compatibility: - allocate zBuff on demand (restricted stack space on old compilers) - 2 bytes in zDrive in include '\0' - pass drive number to DosQueryCurrentDir() instead of 0 to make EMX work - zFull does not need to be preallocated (CVS 4149)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cc2105176563c352a6dccef89a429a76b6f3adf5
User & Date: pweilbacher 2007-07-01 15:41:03
Context
2007-07-01
21:18
Remove an unnecessary temporary variable for clarity of presentation in a loop that GCC 4.2.0 is miscompiling. Ticket #2469. GCC 4.2.0 miscompiles this loop regardless of whether or not the temporary variable is used, but by removing the variable, we hope to make it easier to explain the problem to GCC maintainers. The error only appears if -ftree-vrp is used (which is turned on by -O2). (CVS 4150) check-in: 35ae398b user: drh tags: trunk
15:41
Change OS/2 version of sqlite3Os2FullPathname() for cross-compiler compatibility: - allocate zBuff on demand (restricted stack space on old compilers) - 2 bytes in zDrive in include '\0' - pass drive number to DosQueryCurrentDir() instead of 0 to make EMX work - zFull does not need to be preallocated (CVS 4149) check-in: cc210517 user: pweilbacher tags: trunk
2007-06-30
16:30
Including os2safe.h from os_os2.c is no longer necessary (now that it's including from os.h) (CVS 4148) check-in: 6432bbe1 user: pweilbacher tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_os2.c.

678
679
680
681
682
683
684
685
686
687
688
689






690
691
692

693
694




695
696
697
698
699
700
701
** is no longer needed.
*/
char *sqlite3Os2FullPathname( const char *zRelative ){
  char *zFull = 0;
  if( strchr(zRelative, ':') ){
    sqlite3SetString( &zFull, zRelative, (char*)0 );
  }else{
    char zBuff[SQLITE_TEMPNAME_SIZE - 2] = {0};
    char zDrive[1] = {0};
    ULONG cbzFullLen = SQLITE_TEMPNAME_SIZE;
    ULONG ulDriveNum = 0;
    ULONG ulDriveMap = 0;






    DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap );
    DosQueryCurrentDir( 0L, zBuff, &cbzFullLen );
    zFull = sqliteMalloc( cbzFullLen );

    sprintf( zDrive, "%c", (char)('A' + ulDriveNum - 1) );
    sqlite3SetString( &zFull, zDrive, ":\\", zBuff, "\\", zRelative, (char*)0 );




  }
  return zFull;
}

/*
** The fullSync option is meaningless on os2, or correct me if I'm wrong.  This is a no-op.
** From os_unix.c: Change the value of the fullsync flag in the given file descriptor.







<
<
<


>
>
>
>
>
>
|
<
<
>
|
|
>
>
>
>







678
679
680
681
682
683
684



685
686
687
688
689
690
691
692
693


694
695
696
697
698
699
700
701
702
703
704
705
706
707
** is no longer needed.
*/
char *sqlite3Os2FullPathname( const char *zRelative ){
  char *zFull = 0;
  if( strchr(zRelative, ':') ){
    sqlite3SetString( &zFull, zRelative, (char*)0 );
  }else{



    ULONG ulDriveNum = 0;
    ULONG ulDriveMap = 0;
    ULONG cbzBufLen = SQLITE_TEMPNAME_SIZE;
    char zDrive[2];
    char *zBuff;

    zBuff = sqliteMalloc( cbzBufLen );
    if( zBuff != 0 ){
      DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap );


      if( DosQueryCurrentDir( ulDriveNum, zBuff, &cbzBufLen ) == NO_ERROR ){
        sprintf( zDrive, "%c", (char)('A' + ulDriveNum - 1) );
        sqlite3SetString( &zFull, zDrive, ":\\", zBuff,
                          "\\", zRelative, (char*)0 );
      }
      sqliteFree( zBuff );
    }
  }
  return zFull;
}

/*
** The fullSync option is meaningless on os2, or correct me if I'm wrong.  This is a no-op.
** From os_unix.c: Change the value of the fullsync flag in the given file descriptor.