Fossil SCM
Fix incorrect detection of fossil.exe with an appended database. [forum:/info/2026-09-27T08:05:34Z|Forum 2026-09-27T08:05:34Z].
Commit
76742655f00daf858779bc7778dba167f7593791837193f555ea66c9767670cd
Parent
bfb11d30b68b898…
1 file changed
+10
-2
+10
-2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -692,12 +692,20 @@ | ||
| 692 | 692 | ** Check to see if the Fossil binary contains an appended repository |
| 693 | 693 | ** file using the appendvfs extension. If so, change command-line arguments |
| 694 | 694 | ** to cause Fossil to launch with "fossil ui" on that repo. |
| 695 | 695 | */ |
| 696 | 696 | static int fossilExeHasAppendedRepo(void){ |
| 697 | - extern int deduceDatabaseType(const char*,int); | |
| 698 | - if( 2==deduceDatabaseType(g.nameOfExe,0) ){ | |
| 697 | + int rc; | |
| 698 | + /* Warning: dedeuceDatabaseType is an internal function of the SQLite | |
| 699 | + ** CLI and is subject to change. Verify the following function template | |
| 700 | + ** when updating to a newer SQLite */ | |
| 701 | + extern int deduceDatabaseType(const char*,int,int); | |
| 702 | + | |
| 703 | + g.dbIgnoreErrors++; | |
| 704 | + rc = deduceDatabaseType(g.nameOfExe,0,SQLITE_OPEN_READWRITE); | |
| 705 | + g.dbIgnoreErrors--; | |
| 706 | + if( rc ){ | |
| 699 | 707 | static char *azAltArgv[] = { 0, "ui", 0, 0 }; |
| 700 | 708 | azAltArgv[0] = g.nameOfExe; |
| 701 | 709 | azAltArgv[2] = g.nameOfExe; |
| 702 | 710 | g.argv = azAltArgv; |
| 703 | 711 | g.argc = 3; |
| 704 | 712 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -692,12 +692,20 @@ | |
| 692 | ** Check to see if the Fossil binary contains an appended repository |
| 693 | ** file using the appendvfs extension. If so, change command-line arguments |
| 694 | ** to cause Fossil to launch with "fossil ui" on that repo. |
| 695 | */ |
| 696 | static int fossilExeHasAppendedRepo(void){ |
| 697 | extern int deduceDatabaseType(const char*,int); |
| 698 | if( 2==deduceDatabaseType(g.nameOfExe,0) ){ |
| 699 | static char *azAltArgv[] = { 0, "ui", 0, 0 }; |
| 700 | azAltArgv[0] = g.nameOfExe; |
| 701 | azAltArgv[2] = g.nameOfExe; |
| 702 | g.argv = azAltArgv; |
| 703 | g.argc = 3; |
| 704 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -692,12 +692,20 @@ | |
| 692 | ** Check to see if the Fossil binary contains an appended repository |
| 693 | ** file using the appendvfs extension. If so, change command-line arguments |
| 694 | ** to cause Fossil to launch with "fossil ui" on that repo. |
| 695 | */ |
| 696 | static int fossilExeHasAppendedRepo(void){ |
| 697 | int rc; |
| 698 | /* Warning: dedeuceDatabaseType is an internal function of the SQLite |
| 699 | ** CLI and is subject to change. Verify the following function template |
| 700 | ** when updating to a newer SQLite */ |
| 701 | extern int deduceDatabaseType(const char*,int,int); |
| 702 | |
| 703 | g.dbIgnoreErrors++; |
| 704 | rc = deduceDatabaseType(g.nameOfExe,0,SQLITE_OPEN_READWRITE); |
| 705 | g.dbIgnoreErrors--; |
| 706 | if( rc ){ |
| 707 | static char *azAltArgv[] = { 0, "ui", 0, 0 }; |
| 708 | azAltArgv[0] = g.nameOfExe; |
| 709 | azAltArgv[2] = g.nameOfExe; |
| 710 | g.argv = azAltArgv; |
| 711 | g.argc = 3; |
| 712 |