Fossil SCM

Be sure to call mbcsToUtf8() when opening the global configuration database. Ticket [c7c36ef52edab]

drh 2009-08-15 21:38 trunk
Commit a25092b14ca85df3635bff9c54958ca91b17081c
1 file changed +6 -3
+6 -3
--- src/db.c
+++ src/db.c
@@ -629,10 +629,13 @@
629629
int rc;
630630
const char *zVfs;
631631
sqlite3 *db;
632632
633633
zVfs = getenv("FOSSIL_VFS");
634
+#ifdef __MINGW32__
635
+ zDbName = mbcsToUtf8(zDbName);
636
+#endif
634637
rc = sqlite3_open_v2(
635638
zDbName, &db,
636639
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
637640
zVfs
638641
);
@@ -648,17 +651,17 @@
648651
** zDbName is the name of a database file. If no other database
649652
** file is open, then open this one. If another database file is
650653
** already open, then attach zDbName using the name zLabel.
651654
*/
652655
void db_open_or_attach(const char *zDbName, const char *zLabel){
653
-#ifdef __MINGW32__
654
- zDbName = mbcsToUtf8(zDbName);
655
-#endif
656656
if( !g.db ){
657657
g.db = openDatabase(zDbName);
658658
db_connection_init();
659659
}else{
660
+#ifdef __MINGW32__
661
+ zDbName = mbcsToUtf8(zDbName);
662
+#endif
660663
db_multi_exec("ATTACH DATABASE %Q AS %s", zDbName, zLabel);
661664
}
662665
}
663666
664667
/*
665668
--- src/db.c
+++ src/db.c
@@ -629,10 +629,13 @@
629 int rc;
630 const char *zVfs;
631 sqlite3 *db;
632
633 zVfs = getenv("FOSSIL_VFS");
 
 
 
634 rc = sqlite3_open_v2(
635 zDbName, &db,
636 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
637 zVfs
638 );
@@ -648,17 +651,17 @@
648 ** zDbName is the name of a database file. If no other database
649 ** file is open, then open this one. If another database file is
650 ** already open, then attach zDbName using the name zLabel.
651 */
652 void db_open_or_attach(const char *zDbName, const char *zLabel){
653 #ifdef __MINGW32__
654 zDbName = mbcsToUtf8(zDbName);
655 #endif
656 if( !g.db ){
657 g.db = openDatabase(zDbName);
658 db_connection_init();
659 }else{
 
 
 
660 db_multi_exec("ATTACH DATABASE %Q AS %s", zDbName, zLabel);
661 }
662 }
663
664 /*
665
--- src/db.c
+++ src/db.c
@@ -629,10 +629,13 @@
629 int rc;
630 const char *zVfs;
631 sqlite3 *db;
632
633 zVfs = getenv("FOSSIL_VFS");
634 #ifdef __MINGW32__
635 zDbName = mbcsToUtf8(zDbName);
636 #endif
637 rc = sqlite3_open_v2(
638 zDbName, &db,
639 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
640 zVfs
641 );
@@ -648,17 +651,17 @@
651 ** zDbName is the name of a database file. If no other database
652 ** file is open, then open this one. If another database file is
653 ** already open, then attach zDbName using the name zLabel.
654 */
655 void db_open_or_attach(const char *zDbName, const char *zLabel){
 
 
 
656 if( !g.db ){
657 g.db = openDatabase(zDbName);
658 db_connection_init();
659 }else{
660 #ifdef __MINGW32__
661 zDbName = mbcsToUtf8(zDbName);
662 #endif
663 db_multi_exec("ATTACH DATABASE %Q AS %s", zDbName, zLabel);
664 }
665 }
666
667 /*
668

Keyboard Shortcuts

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