Fossil SCM

Remove usage of the 'win32-longpath' VFS as it is unlikely to work correctly with the various MSVCRT functions currently required by Fossil.

mistachkin 2013-12-11 23:20 trunk
Commit 19de4b5bcdc8236f060361573230e86b1f28949a
+5 -1
--- src/db.c
+++ src/db.c
@@ -715,11 +715,15 @@
715715
716716
#if defined(__CYGWIN__)
717717
zDbName = fossil_utf8_to_filename(zDbName);
718718
#endif
719719
if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
720
- rc = sqlite3_open(zDbName, &db);
720
+ rc = sqlite3_open_v2(
721
+ zDbName, &db,
722
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
723
+ g.zVfsName
724
+ );
721725
if( rc!=SQLITE_OK ){
722726
db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
723727
}
724728
sqlite3_busy_timeout(db, 5000);
725729
sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
726730
--- src/db.c
+++ src/db.c
@@ -715,11 +715,15 @@
715
716 #if defined(__CYGWIN__)
717 zDbName = fossil_utf8_to_filename(zDbName);
718 #endif
719 if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
720 rc = sqlite3_open(zDbName, &db);
 
 
 
 
721 if( rc!=SQLITE_OK ){
722 db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
723 }
724 sqlite3_busy_timeout(db, 5000);
725 sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
726
--- src/db.c
+++ src/db.c
@@ -715,11 +715,15 @@
715
716 #if defined(__CYGWIN__)
717 zDbName = fossil_utf8_to_filename(zDbName);
718 #endif
719 if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
720 rc = sqlite3_open_v2(
721 zDbName, &db,
722 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
723 g.zVfsName
724 );
725 if( rc!=SQLITE_OK ){
726 db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
727 }
728 sqlite3_busy_timeout(db, 5000);
729 sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
730
+1 -11
--- src/file.c
+++ src/file.c
@@ -74,21 +74,11 @@
7474
}else{
7575
rc = stat(zMbcs, buf);
7676
}
7777
#else
7878
wchar_t *zMbcs = fossil_utf8_to_filename(zFilename);
79
- if( memcmp(zMbcs, L"\\\\?\\", 8)==0 ){
80
- /* Unfortunately, _wstati64 cannot handle extended prefixes. */
81
- if( memcmp(zMbcs+4, "UNC\\", 8)==0 ){
82
- zMbcs[6] = '\\';
83
- rc = _wstati64(zMbcs+6, buf);
84
- }else{
85
- rc = _wstati64(zMbcs+4, buf);
86
- }
87
- }else{
88
- rc = _wstati64(zMbcs, buf);
89
- }
79
+ rc = _wstati64(zMbcs, buf);
9080
#endif
9181
fossil_filename_free(zMbcs);
9282
return rc;
9383
}
9484
9585
--- src/file.c
+++ src/file.c
@@ -74,21 +74,11 @@
74 }else{
75 rc = stat(zMbcs, buf);
76 }
77 #else
78 wchar_t *zMbcs = fossil_utf8_to_filename(zFilename);
79 if( memcmp(zMbcs, L"\\\\?\\", 8)==0 ){
80 /* Unfortunately, _wstati64 cannot handle extended prefixes. */
81 if( memcmp(zMbcs+4, "UNC\\", 8)==0 ){
82 zMbcs[6] = '\\';
83 rc = _wstati64(zMbcs+6, buf);
84 }else{
85 rc = _wstati64(zMbcs+4, buf);
86 }
87 }else{
88 rc = _wstati64(zMbcs, buf);
89 }
90 #endif
91 fossil_filename_free(zMbcs);
92 return rc;
93 }
94
95
--- src/file.c
+++ src/file.c
@@ -74,21 +74,11 @@
74 }else{
75 rc = stat(zMbcs, buf);
76 }
77 #else
78 wchar_t *zMbcs = fossil_utf8_to_filename(zFilename);
79 rc = _wstati64(zMbcs, buf);
 
 
 
 
 
 
 
 
 
 
80 #endif
81 fossil_filename_free(zMbcs);
82 return rc;
83 }
84
85
+15 -3
--- src/login.c
+++ src/login.c
@@ -695,11 +695,15 @@
695695
"SELECT value FROM config WHERE name='peer-repo-%q'",
696696
zCode
697697
);
698698
if( zOtherRepo==0 ) return 0; /* No such peer repository */
699699
700
- rc = sqlite3_open(zOtherRepo, &pOther);
700
+ rc = sqlite3_open_v2(
701
+ zOtherRepo, &pOther,
702
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
703
+ g.zVfsName
704
+ );
701705
if( rc==SQLITE_OK ){
702706
sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
703707
sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
704708
constant_time_cmp_function, 0, 0);
705709
sqlite3_busy_timeout(pOther, 5000);
@@ -1372,11 +1376,15 @@
13721376
"DELETE FROM config WHERE name GLOB 'peer-*-%q'",
13731377
&zLabel[10]
13741378
);
13751379
continue;
13761380
}
1377
- rc = sqlite3_open_v2(zRepoName, &pPeer, SQLITE_OPEN_READWRITE, 0);
1381
+ rc = sqlite3_open_v2(
1382
+ zRepoName, &pPeer,
1383
+ SQLITE_OPEN_READWRITE,
1384
+ g.zVfsName
1385
+ );
13781386
if( rc!=SQLITE_OK ){
13791387
blob_appendf(&err, "%s%s: %s%s", zPrefix, zRepoName,
13801388
sqlite3_errmsg(pPeer), zSuffix);
13811389
nErr++;
13821390
sqlite3_close(pPeer);
@@ -1459,11 +1467,15 @@
14591467
/* Make sure the other repository is a valid Fossil database */
14601468
if( file_size(zRepo)<0 ){
14611469
*pzErrMsg = mprintf("repository file \"%s\" does not exist", zRepo);
14621470
return;
14631471
}
1464
- rc = sqlite3_open(zRepo, &pOther);
1472
+ rc = sqlite3_open_v2(
1473
+ zRepo, &pOther,
1474
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
1475
+ g.zVfsName
1476
+ );
14651477
if( rc!=SQLITE_OK ){
14661478
*pzErrMsg = mprintf(sqlite3_errmsg(pOther));
14671479
}else{
14681480
rc = sqlite3_exec(pOther, "SELECT count(*) FROM user", 0, 0, pzErrMsg);
14691481
}
14701482
--- src/login.c
+++ src/login.c
@@ -695,11 +695,15 @@
695 "SELECT value FROM config WHERE name='peer-repo-%q'",
696 zCode
697 );
698 if( zOtherRepo==0 ) return 0; /* No such peer repository */
699
700 rc = sqlite3_open(zOtherRepo, &pOther);
 
 
 
 
701 if( rc==SQLITE_OK ){
702 sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
703 sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
704 constant_time_cmp_function, 0, 0);
705 sqlite3_busy_timeout(pOther, 5000);
@@ -1372,11 +1376,15 @@
1372 "DELETE FROM config WHERE name GLOB 'peer-*-%q'",
1373 &zLabel[10]
1374 );
1375 continue;
1376 }
1377 rc = sqlite3_open_v2(zRepoName, &pPeer, SQLITE_OPEN_READWRITE, 0);
 
 
 
 
1378 if( rc!=SQLITE_OK ){
1379 blob_appendf(&err, "%s%s: %s%s", zPrefix, zRepoName,
1380 sqlite3_errmsg(pPeer), zSuffix);
1381 nErr++;
1382 sqlite3_close(pPeer);
@@ -1459,11 +1467,15 @@
1459 /* Make sure the other repository is a valid Fossil database */
1460 if( file_size(zRepo)<0 ){
1461 *pzErrMsg = mprintf("repository file \"%s\" does not exist", zRepo);
1462 return;
1463 }
1464 rc = sqlite3_open(zRepo, &pOther);
 
 
 
 
1465 if( rc!=SQLITE_OK ){
1466 *pzErrMsg = mprintf(sqlite3_errmsg(pOther));
1467 }else{
1468 rc = sqlite3_exec(pOther, "SELECT count(*) FROM user", 0, 0, pzErrMsg);
1469 }
1470
--- src/login.c
+++ src/login.c
@@ -695,11 +695,15 @@
695 "SELECT value FROM config WHERE name='peer-repo-%q'",
696 zCode
697 );
698 if( zOtherRepo==0 ) return 0; /* No such peer repository */
699
700 rc = sqlite3_open_v2(
701 zOtherRepo, &pOther,
702 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
703 g.zVfsName
704 );
705 if( rc==SQLITE_OK ){
706 sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
707 sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
708 constant_time_cmp_function, 0, 0);
709 sqlite3_busy_timeout(pOther, 5000);
@@ -1372,11 +1376,15 @@
1376 "DELETE FROM config WHERE name GLOB 'peer-*-%q'",
1377 &zLabel[10]
1378 );
1379 continue;
1380 }
1381 rc = sqlite3_open_v2(
1382 zRepoName, &pPeer,
1383 SQLITE_OPEN_READWRITE,
1384 g.zVfsName
1385 );
1386 if( rc!=SQLITE_OK ){
1387 blob_appendf(&err, "%s%s: %s%s", zPrefix, zRepoName,
1388 sqlite3_errmsg(pPeer), zSuffix);
1389 nErr++;
1390 sqlite3_close(pPeer);
@@ -1459,11 +1467,15 @@
1467 /* Make sure the other repository is a valid Fossil database */
1468 if( file_size(zRepo)<0 ){
1469 *pzErrMsg = mprintf("repository file \"%s\" does not exist", zRepo);
1470 return;
1471 }
1472 rc = sqlite3_open_v2(
1473 zRepo, &pOther,
1474 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
1475 g.zVfsName
1476 );
1477 if( rc!=SQLITE_OK ){
1478 *pzErrMsg = mprintf(sqlite3_errmsg(pOther));
1479 }else{
1480 rc = sqlite3_exec(pOther, "SELECT count(*) FROM user", 0, 0, pzErrMsg);
1481 }
1482
+8 -13
--- src/main.c
+++ src/main.c
@@ -119,10 +119,11 @@
119119
struct Global {
120120
int argc; char **argv; /* Command-line arguments to the program */
121121
char *nameOfExe; /* Full path of executable. */
122122
const char *zErrlog; /* Log errors to this file, if not NULL */
123123
int isConst; /* True if the output is unchanging */
124
+ const char *zVfsName; /* The VFS to use for database connections */
124125
sqlite3 *db; /* The connection to the databases */
125126
sqlite3 *dbConfig; /* Separate connection for global_config table */
126127
int useAttach; /* True if global_config is attached to repository */
127128
const char *zConfigDbName;/* Path of the config database. NULL if not open */
128129
sqlite3_int64 now; /* Seconds since 1970 */
@@ -549,11 +550,10 @@
549550
#endif
550551
int main(int argc, char **argv)
551552
#endif
552553
{
553554
const char *zCmdName = "unknown";
554
- const char *zVfsName;
555555
int idx;
556556
int rc;
557557
sqlite3_config(SQLITE_CONFIG_SINGLETHREAD);
558558
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
559559
memset(&g, 0, sizeof(g));
@@ -577,25 +577,20 @@
577577
memset(&g.tcl, 0, sizeof(TclContext));
578578
g.tcl.argc = g.argc;
579579
g.tcl.argv = copy_args(g.argc, g.argv); /* save full arguments */
580580
#endif
581581
g.mainTimerId = fossil_timer_start();
582
- zVfsName = find_option("vfs",0,1);
583
- if( zVfsName==0 ){
584
- zVfsName = fossil_getenv("FOSSIL_VFS");
585
- }
586
-#if defined(_WIN32) || defined(__CYGWIN__)
587
- if( zVfsName==0 && sqlite3_libversion_number()>=3008001 ){
588
- zVfsName = "win32-longpath";
589
- }
590
-#endif
591
- if( zVfsName ){
592
- sqlite3_vfs *pVfs = sqlite3_vfs_find(zVfsName);
582
+ g.zVfsName = find_option("vfs",0,1);
583
+ if( g.zVfsName==0 ){
584
+ g.zVfsName = fossil_getenv("FOSSIL_VFS");
585
+ }
586
+ if( g.zVfsName ){
587
+ sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
593588
if( pVfs ){
594589
sqlite3_vfs_register(pVfs, 1);
595590
}else{
596
- fossil_fatal("no such VFS: \"%s\"", zVfsName);
591
+ fossil_fatal("no such VFS: \"%s\"", g.zVfsName);
597592
}
598593
}
599594
if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
600595
zCmdName = "cgi";
601596
g.isHTTP = 1;
602597
--- src/main.c
+++ src/main.c
@@ -119,10 +119,11 @@
119 struct Global {
120 int argc; char **argv; /* Command-line arguments to the program */
121 char *nameOfExe; /* Full path of executable. */
122 const char *zErrlog; /* Log errors to this file, if not NULL */
123 int isConst; /* True if the output is unchanging */
 
124 sqlite3 *db; /* The connection to the databases */
125 sqlite3 *dbConfig; /* Separate connection for global_config table */
126 int useAttach; /* True if global_config is attached to repository */
127 const char *zConfigDbName;/* Path of the config database. NULL if not open */
128 sqlite3_int64 now; /* Seconds since 1970 */
@@ -549,11 +550,10 @@
549 #endif
550 int main(int argc, char **argv)
551 #endif
552 {
553 const char *zCmdName = "unknown";
554 const char *zVfsName;
555 int idx;
556 int rc;
557 sqlite3_config(SQLITE_CONFIG_SINGLETHREAD);
558 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
559 memset(&g, 0, sizeof(g));
@@ -577,25 +577,20 @@
577 memset(&g.tcl, 0, sizeof(TclContext));
578 g.tcl.argc = g.argc;
579 g.tcl.argv = copy_args(g.argc, g.argv); /* save full arguments */
580 #endif
581 g.mainTimerId = fossil_timer_start();
582 zVfsName = find_option("vfs",0,1);
583 if( zVfsName==0 ){
584 zVfsName = fossil_getenv("FOSSIL_VFS");
585 }
586 #if defined(_WIN32) || defined(__CYGWIN__)
587 if( zVfsName==0 && sqlite3_libversion_number()>=3008001 ){
588 zVfsName = "win32-longpath";
589 }
590 #endif
591 if( zVfsName ){
592 sqlite3_vfs *pVfs = sqlite3_vfs_find(zVfsName);
593 if( pVfs ){
594 sqlite3_vfs_register(pVfs, 1);
595 }else{
596 fossil_fatal("no such VFS: \"%s\"", zVfsName);
597 }
598 }
599 if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
600 zCmdName = "cgi";
601 g.isHTTP = 1;
602
--- src/main.c
+++ src/main.c
@@ -119,10 +119,11 @@
119 struct Global {
120 int argc; char **argv; /* Command-line arguments to the program */
121 char *nameOfExe; /* Full path of executable. */
122 const char *zErrlog; /* Log errors to this file, if not NULL */
123 int isConst; /* True if the output is unchanging */
124 const char *zVfsName; /* The VFS to use for database connections */
125 sqlite3 *db; /* The connection to the databases */
126 sqlite3 *dbConfig; /* Separate connection for global_config table */
127 int useAttach; /* True if global_config is attached to repository */
128 const char *zConfigDbName;/* Path of the config database. NULL if not open */
129 sqlite3_int64 now; /* Seconds since 1970 */
@@ -549,11 +550,10 @@
550 #endif
551 int main(int argc, char **argv)
552 #endif
553 {
554 const char *zCmdName = "unknown";
 
555 int idx;
556 int rc;
557 sqlite3_config(SQLITE_CONFIG_SINGLETHREAD);
558 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
559 memset(&g, 0, sizeof(g));
@@ -577,25 +577,20 @@
577 memset(&g.tcl, 0, sizeof(TclContext));
578 g.tcl.argc = g.argc;
579 g.tcl.argv = copy_args(g.argc, g.argv); /* save full arguments */
580 #endif
581 g.mainTimerId = fossil_timer_start();
582 g.zVfsName = find_option("vfs",0,1);
583 if( g.zVfsName==0 ){
584 g.zVfsName = fossil_getenv("FOSSIL_VFS");
585 }
586 if( g.zVfsName ){
587 sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
 
 
 
 
 
588 if( pVfs ){
589 sqlite3_vfs_register(pVfs, 1);
590 }else{
591 fossil_fatal("no such VFS: \"%s\"", g.zVfsName);
592 }
593 }
594 if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
595 zCmdName = "cgi";
596 g.isHTTP = 1;
597
+1 -1
--- src/main.mk
+++ src/main.mk
@@ -1160,11 +1160,11 @@
11601160
$(OBJDIR)/zip.o: $(OBJDIR)/zip_.c $(OBJDIR)/zip.h $(SRCDIR)/config.h
11611161
$(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c
11621162
11631163
$(OBJDIR)/zip.h: $(OBJDIR)/headers
11641164
$(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1165
- $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_WIN32_NO_ANSI -DSQLITE_WINNT_MAX_PATH_CHARS=4096 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1165
+ $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_WIN32_NO_ANSI -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
11661166
11671167
$(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
11681168
$(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -Dsqlite3_strglob=strglob -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
11691169
11701170
$(OBJDIR)/th.o: $(SRCDIR)/th.c
11711171
--- src/main.mk
+++ src/main.mk
@@ -1160,11 +1160,11 @@
1160 $(OBJDIR)/zip.o: $(OBJDIR)/zip_.c $(OBJDIR)/zip.h $(SRCDIR)/config.h
1161 $(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c
1162
1163 $(OBJDIR)/zip.h: $(OBJDIR)/headers
1164 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1165 $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_WIN32_NO_ANSI -DSQLITE_WINNT_MAX_PATH_CHARS=4096 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1166
1167 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1168 $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -Dsqlite3_strglob=strglob -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
1169
1170 $(OBJDIR)/th.o: $(SRCDIR)/th.c
1171
--- src/main.mk
+++ src/main.mk
@@ -1160,11 +1160,11 @@
1160 $(OBJDIR)/zip.o: $(OBJDIR)/zip_.c $(OBJDIR)/zip.h $(SRCDIR)/config.h
1161 $(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c
1162
1163 $(OBJDIR)/zip.h: $(OBJDIR)/headers
1164 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1165 $(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_WIN32_NO_ANSI -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
1166
1167 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1168 $(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -Dsqlite3_strglob=strglob -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
1169
1170 $(OBJDIR)/th.o: $(SRCDIR)/th.c
1171
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -295,11 +295,11 @@
295295
append opt " -DSQLITE_ENABLE_EXPLAIN_COMMENTS"
296296
append opt " -Dlocaltime=fossil_localtime"
297297
append opt " -DSQLITE_ENABLE_LOCKING_STYLE=0"
298298
append opt " -DSQLITE_WIN32_NO_ANSI"
299299
set SQLITE_OPTIONS $opt
300
-writeln "\t\$(XTCC) $opt -DSQLITE_WINNT_MAX_PATH_CHARS=4096 -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
300
+writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
301301
302302
writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
303303
set opt {-Dmain=sqlite3_shell}
304304
append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
305305
append opt " -Dsqlite3_strglob=strglob"
306306
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -295,11 +295,11 @@
295 append opt " -DSQLITE_ENABLE_EXPLAIN_COMMENTS"
296 append opt " -Dlocaltime=fossil_localtime"
297 append opt " -DSQLITE_ENABLE_LOCKING_STYLE=0"
298 append opt " -DSQLITE_WIN32_NO_ANSI"
299 set SQLITE_OPTIONS $opt
300 writeln "\t\$(XTCC) $opt -DSQLITE_WINNT_MAX_PATH_CHARS=4096 -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
301
302 writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
303 set opt {-Dmain=sqlite3_shell}
304 append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
305 append opt " -Dsqlite3_strglob=strglob"
306
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -295,11 +295,11 @@
295 append opt " -DSQLITE_ENABLE_EXPLAIN_COMMENTS"
296 append opt " -Dlocaltime=fossil_localtime"
297 append opt " -DSQLITE_ENABLE_LOCKING_STYLE=0"
298 append opt " -DSQLITE_WIN32_NO_ANSI"
299 set SQLITE_OPTIONS $opt
300 writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
301
302 writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
303 set opt {-Dmain=sqlite3_shell}
304 append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
305 append opt " -Dsqlite3_strglob=strglob"
306
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -124,12 +124,10 @@
124124
g.repositoryOpen = 1;
125125
g.db = db;
126126
return SQLITE_OK;
127127
}
128128
129
-static sqlite3_vfs *pDefaultVfs = 0;
130
-
131129
/*
132130
** COMMAND: sqlite3
133131
**
134132
** Usage: %fossil sqlite3 ?DATABASE? ?OPTIONS?
135133
**
@@ -143,12 +141,10 @@
143141
*/
144142
void sqlite3_cmd(void){
145143
extern int sqlite3_shell(int, char**);
146144
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
147145
db_close(1);
148
- /* Determine default VFS and keep it after shutdown */
149
- pDefaultVfs = sqlite3_vfs_find(0);
150146
sqlite3_shutdown();
151147
sqlite3_shell(g.argc-1, g.argv+1);
152148
g.db = 0;
153149
}
154150
@@ -155,9 +151,8 @@
155151
/*
156152
** This routine is called by the patched sqlite3 command-line shell in order
157153
** to load the name and database connection for the open Fossil database.
158154
*/
159155
void fossil_open(const char **pzRepoName){
160
- if( pDefaultVfs ) sqlite3_vfs_register(pDefaultVfs, 1);
161156
sqlite3_auto_extension((void(*)(void))sqlcmd_autoinit);
162157
*pzRepoName = g.zRepositoryName;
163158
}
164159
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -124,12 +124,10 @@
124 g.repositoryOpen = 1;
125 g.db = db;
126 return SQLITE_OK;
127 }
128
129 static sqlite3_vfs *pDefaultVfs = 0;
130
131 /*
132 ** COMMAND: sqlite3
133 **
134 ** Usage: %fossil sqlite3 ?DATABASE? ?OPTIONS?
135 **
@@ -143,12 +141,10 @@
143 */
144 void sqlite3_cmd(void){
145 extern int sqlite3_shell(int, char**);
146 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
147 db_close(1);
148 /* Determine default VFS and keep it after shutdown */
149 pDefaultVfs = sqlite3_vfs_find(0);
150 sqlite3_shutdown();
151 sqlite3_shell(g.argc-1, g.argv+1);
152 g.db = 0;
153 }
154
@@ -155,9 +151,8 @@
155 /*
156 ** This routine is called by the patched sqlite3 command-line shell in order
157 ** to load the name and database connection for the open Fossil database.
158 */
159 void fossil_open(const char **pzRepoName){
160 if( pDefaultVfs ) sqlite3_vfs_register(pDefaultVfs, 1);
161 sqlite3_auto_extension((void(*)(void))sqlcmd_autoinit);
162 *pzRepoName = g.zRepositoryName;
163 }
164
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -124,12 +124,10 @@
124 g.repositoryOpen = 1;
125 g.db = db;
126 return SQLITE_OK;
127 }
128
 
 
129 /*
130 ** COMMAND: sqlite3
131 **
132 ** Usage: %fossil sqlite3 ?DATABASE? ?OPTIONS?
133 **
@@ -143,12 +141,10 @@
141 */
142 void sqlite3_cmd(void){
143 extern int sqlite3_shell(int, char**);
144 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
145 db_close(1);
 
 
146 sqlite3_shutdown();
147 sqlite3_shell(g.argc-1, g.argv+1);
148 g.db = 0;
149 }
150
@@ -155,9 +151,8 @@
151 /*
152 ** This routine is called by the patched sqlite3 command-line shell in order
153 ** to load the name and database connection for the open Fossil database.
154 */
155 void fossil_open(const char **pzRepoName){
 
156 sqlite3_auto_extension((void(*)(void))sqlcmd_autoinit);
157 *pzRepoName = g.zRepositoryName;
158 }
159

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button