]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
make os2Truncate() actually do something and fix os2FullPathname() to be more elegant...
authorpweilbacher <pweilbacher@noemail.net>
Fri, 1 Feb 2008 00:31:59 +0000 (00:31 +0000)
committerpweilbacher <pweilbacher@noemail.net>
Fri, 1 Feb 2008 00:31:59 +0000 (00:31 +0000)
FossilOrigin-Name: 921c7a0ac4581255ea5061980ff7991088b9b78a

manifest
manifest.uuid
src/os_os2.c

index f216e1c1a949094fde4596ca84919abb79532f17..4a79ea797678fbdd2f605af941d6ef2e7b1cff58 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sproblem\swith\svirtual\stables\sand\sleft\sjoins\sintroduced\sby\ncheck-in\s(4761).\s\sTicket\s#2894\sand\s#2913.\s(CVS\s4765)
-D 2008-01-31T19:34:52
+C make\sos2Truncate()\sactually\sdo\ssomething\sand\sfix\sos2FullPathname()\sto\sbe\smore\selegant\sand\swork\smore\scorrectly\sin\sall\scases\s(Ticket\s#2904)\s(CVS\s4766)
+D 2008-02-01T00:31:59
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in bc2b5df3e3d0d4b801b824b7ef6dec43812b049b
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -117,7 +117,7 @@ F src/mutex_w32.c 6e197765f283815496193e78e9548b5d0e53b68e
 F src/os.c 50c0c1706c35f872db312815aaecc4b5ebcd6a4c
 F src/os.h d04706d54a072c7a30ab9e346ad916ef28c842d5
 F src/os_common.h 98862f120ca6bf7a48ce8b16f158b77d00bc9d2f
-F src/os_os2.c 4aca68faa5fe20e41e1b123a46087ebd9e0bb170
+F src/os_os2.c 0c3e3f98ae76a59d42f6a72bbf2999eff3b059da
 F src/os_os2.h c3f7d0af7e3453d1d7aa81b06c0a56f5a226530b
 F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
@@ -614,7 +614,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P cb5bf4642f30ccd9052d76c3a47e7c5afc32afe6
-R a37040921705bf91b118e412481fa829
-U drh
-Z 0aaeaf0fdf81d2ffa30bec3d67135f9d
+P ebeac2a499ce16ac7e6d12daa5ce9d41e9067d28
+R c6eab2721dc7a2503f5dba9236f9ecde
+U pweilbacher
+Z 3abc0ef4950723d8e67f5617acc8d019
index 8a5d85d7bc9029849b29ff1697a4dc66a0af440a..9502f3a43d5f70b23cb2825c1b478002137422a4 100644 (file)
@@ -1 +1 @@
-ebeac2a499ce16ac7e6d12daa5ce9d41e9067d28
\ No newline at end of file
+921c7a0ac4581255ea5061980ff7991088b9b78a
\ No newline at end of file
index b3f6c69ea77fa11cd3368b146c3868d4f34f3379..a0c2e1213e9f3e224b660fd1caad7e7d452b3b3a 100644 (file)
@@ -165,15 +165,10 @@ int os2Write(
 */
 int os2Truncate( sqlite3_file *id, i64 nByte ){
   APIRET rc = NO_ERROR;
-  ULONG filePosition = 0L;
   os2File *pFile = (os2File*)id;
   OSTRACE3( "TRUNCATE %d %lld\n", pFile->h, nByte );
   SimulateIOError( return SQLITE_IOERR_TRUNCATE );
-  rc = DosSetFilePtr( pFile->h, nByte, FILE_BEGIN, &filePosition );
-  if( rc != NO_ERROR ){
-    return SQLITE_IOERR;
-  }
-  rc = DosSetFilePtr( pFile->h, 0L, FILE_END, &filePosition );
+  rc = DosSetFileSize( pFile->h, nByte );
   return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
 }
 
@@ -790,24 +785,8 @@ static int os2FullPathname(
   int nFull,                  /* Size of output buffer in bytes */
   char *zFull                 /* Output buffer */
 ){
-  if( strchr(zRelative, ':') ){
-    sqlite3_snprintf( nFull, zFull, "%s", zRelative );
-  }else{
-    ULONG ulDriveNum = 0;
-    ULONG ulDriveMap = 0;
-    ULONG cbzBufLen = SQLITE_TEMPNAME_SIZE;
-    char *zBuff = (char*)malloc( cbzBufLen );
-    if( zBuff == 0 ){
-      return SQLITE_NOMEM;
-    }
-    DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap );
-    if( DosQueryCurrentDir( ulDriveNum, (PBYTE)zBuff, &cbzBufLen ) == NO_ERROR ){
-      sqlite3_snprintf( nFull, zFull, "%c:\\%s\\%s",
-                               (char)('A' + ulDriveNum - 1), zBuff, zRelative);
-    }
-    free( zBuff );
-  }
-  return SQLITE_OK;
+  APIRET rc = DosQueryPathInfo( zRelative, FIL_QUERYFULLNAME, zFull, nFull );
+  return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR;
 }
 
 #ifndef SQLITE_OMIT_LOAD_EXTENSION