Index: src/os_os2.c ================================================================== --- src/os_os2.c +++ src/os_os2.c @@ -236,10 +236,17 @@ DosQueryCurrentDisk( &ulDriveNum, &ulDriveMap ); sprintf( (char*)zTempPath, "%c:", (char)( 'A' + ulDriveNum - 1 ) ); } } } + /* strip off a trailing slashes or backslashes, otherwise we would get * + * multiple (back)slashes which causes DosOpen() to fail */ + j = strlen(zTempPath); + while( j > 0 && zTempPath[j-1] == '\\' || zTempPath[j-1] == '/' ){ + j--; + } + zTempPath[j] = '\0'; for(;;){ sprintf( zBuf, "%s\\"TEMP_FILE_PREFIX, zTempPath ); j = strlen( zBuf ); sqlite3Randomness( 15, &zBuf[j] ); for( i = 0; i < 15; i++, j++ ){