mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Enhancements to long-path support in the Win32 VFS.
FossilOrigin-Name: 0119d96decd344ae711388ac8475b92464a6d018ecf73862170f137410036dac
This commit is contained in:
@@ -3699,6 +3699,7 @@ static int SQLITE_TCLAPI DbMain(
|
||||
const char *zFile = 0;
|
||||
const char *zVfs = 0;
|
||||
int flags;
|
||||
int bTranslateFileName = 1;
|
||||
Tcl_DString translatedFilename;
|
||||
int rc;
|
||||
|
||||
@@ -3796,6 +3797,10 @@ static int SQLITE_TCLAPI DbMain(
|
||||
}else{
|
||||
flags &= ~SQLITE_OPEN_URI;
|
||||
}
|
||||
}else if( strcmp(zArg, "-translatefilename")==0 ){
|
||||
if( Tcl_GetBooleanFromObj(interp, objv[i], &bTranslateFileName) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}else{
|
||||
Tcl_AppendResult(interp, "unknown option: ", zArg, (char*)0);
|
||||
return TCL_ERROR;
|
||||
@@ -3805,9 +3810,13 @@ static int SQLITE_TCLAPI DbMain(
|
||||
p = (SqliteDb*)Tcl_Alloc( sizeof(*p) );
|
||||
memset(p, 0, sizeof(*p));
|
||||
if( zFile==0 ) zFile = "";
|
||||
zFile = Tcl_TranslateFileName(interp, zFile, &translatedFilename);
|
||||
if( bTranslateFileName ){
|
||||
zFile = Tcl_TranslateFileName(interp, zFile, &translatedFilename);
|
||||
}
|
||||
rc = sqlite3_open_v2(zFile, &p->db, flags, zVfs);
|
||||
Tcl_DStringFree(&translatedFilename);
|
||||
if( bTranslateFileName ){
|
||||
Tcl_DStringFree(&translatedFilename);
|
||||
}
|
||||
if( p->db ){
|
||||
if( SQLITE_OK!=sqlite3_errcode(p->db) ){
|
||||
zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(p->db));
|
||||
|
Reference in New Issue
Block a user