Index: third_party/sqlite/src/src/test_fs.c |
diff --git a/third_party/sqlite/src/src/test_fs.c b/third_party/sqlite/src/src/test_fs.c |
index 45db0b53b8ae5dffd88d2b7e77bc6894c5a112de..dd590a66232fb5b93ba80e258e8c4e8d43e1ecec 100644 |
--- a/third_party/sqlite/src/src/test_fs.c |
+++ b/third_party/sqlite/src/src/test_fs.c |
@@ -62,7 +62,11 @@ |
** SELECT * FROM fstree WHERE path LIKE '/home/dan/sqlite/%' |
*/ |
#include "sqliteInt.h" |
-#include "tcl.h" |
+#if defined(INCLUDE_SQLITE_TCL_H) |
+# include "sqlite_tcl.h" |
+#else |
+# include "tcl.h" |
+#endif |
#include <stdlib.h> |
#include <string.h> |
@@ -495,10 +499,14 @@ static int fstreeFilter( |
char aWild[2] = { '\0', '\0' }; |
#if SQLITE_OS_WIN |
- zRoot = sqlite3_mprintf("%s%c", getenv("SystemDrive"), '/'); |
- nRoot = strlen(zRoot); |
- zPrefix = sqlite3_mprintf("%s", getenv("SystemDrive")); |
- nPrefix = strlen(zPrefix); |
+ const char *zDrive = windirent_getenv("fstreeDrive"); |
+ if( zDrive==0 ){ |
+ zDrive = windirent_getenv("SystemDrive"); |
+ } |
+ zRoot = sqlite3_mprintf("%s%c", zDrive, '/'); |
+ nRoot = sqlite3Strlen30(zRoot); |
+ zPrefix = sqlite3_mprintf("%s", zDrive); |
+ nPrefix = sqlite3Strlen30(zPrefix); |
#else |
zRoot = "/"; |
nRoot = 1; |
@@ -871,7 +879,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb); |
/* |
** Register the echo virtual table module. |
*/ |
-static int register_fs_module( |
+static int SQLITE_TCLAPI register_fs_module( |
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ |
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ |
int objc, /* Number of arguments */ |