Why don't I get 'g.zConfigDbName' in function db_get()?
/home/juef/fossil/e/fossil: ./fossil ui
db_get()::z(1) |0|
db_get()::z(2) |chromium|
Listening for HTTP requests on TCP port 8080
cgi_http_server()::zBrowser |chromium http://localhost:8080/timeline?c=current
&|
Created new window in existing browser session.
^C
/home/juef/fossil/e/fossil: ./fossil ui ..
db_get()::g.zConfigDbName==0
db_get()::z(5) |0|
cmd_webserver()::zBrowser==0
Listening for HTTP requests on TCP port 8080
cgi_http_server()::zBrowser |echo http://localhost:8080/ &|
http://localhost:8080/
^C
/home/juef/fossil/e/fossil: ./fossil ui ../fossil.fossil
db_get()::z(1) |0|
db_get()::g.zConfigDbName==0
db_get()::z(5) |0|
cmd_webserver()::zBrowser==0
Listening for HTTP requests on TCP port 8080
cgi_http_server()::zBrowser |echo http://localhost:8080/ &|
http://localhost:8080/
^C
Index: src/cgi.c
==
--- src/cgi.c
+++ src/cgi.c
@@ -1769,10 +1769,11 @@
(flags & HTTP_SERVER_SCGI)!=0?"SCGI":"HTTP", iPort);
fflush(stdout);
if( zBrowser ){
assert( strstr(zBrowser,"%d")!=0 );
zBrowser = mprintf(zBrowser /*works-like:"%d"*/, iPort);
+fprintf(stderr, "cgi_http_server()::zBrowser |%s|\n", zBrowser);
#if defined(__CYGWIN__)
/* On Cygwin, we can do better than "echo" */
if( strncmp(zBrowser, "echo ", 5)==0 ){
wchar_t *wUrl = fossil_utf8_to_unicode(zBrowser+5);
wUrl[wcslen(wUrl)-2] = 0; /* Strip terminating " &" */
Index: src/db.c
==
--- src/db.c
+++ src/db.c
@@ -2136,28 +2136,50 @@
** versioned value takes priority.
*/
char *db_get(const char *zName, const char *zDefault){
char *z = 0;
const Setting *pSetting = db_find_setting(zName, 0);
+ int wb = strcmp(zName, "web-browser")==0;
+
if( g.repositoryOpen ){
z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
+if ( wb ){
+ fprintf(stderr, "db_get()::z(1) |%s|\n", z ? z : "0");
+}
+ }
+
+ if ( wb && g.zConfigDbName==0 ){
+fprintf(stderr, "db_get()::g.zConfigDbName==0\n");
}
if( z==0 && g.zConfigDbName ){
db_swap_connections();
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
+if ( wb ){
+ fprintf(stderr, "db_get()::z(2) |%s|\n", z ? z : "0");
+}
db_swap_connections();
}
+
if( pSetting!=0 && pSetting->versionable ){
/* This is a versionable setting, try and get the info from a
** checked out file */
z = db_get_versioned(zName, z);
+if ( wb ){
+ fprintf(stderr, "db_get()::z(3) |%s|\n", z ? z : "0");
+}
}
if( z==0 ){
if( zDefault==0 && pSetting && pSetting->def[0] ){
z = fossil_strdup(pSetting->def);
+ if ( wb ){
+fprintf(stderr, "db_get()::z(4) |%s|\n", z ? z : "0");
+ }
}else{
z = fossil_strdup(zDefault);
+ if ( wb ){
+fprintf(stderr, "db_get()::z(5) |%s|\n", z ? z : "0");
+ }
}
}
return z;
}
char *db_get_mtime(const char *zName, const char *zFormat, const char
*zDefault){
Index: src/main.c
==
--- src/main.c
+++ src/main.c
@@ -2271,10 +2271,11 @@
/* Unix implementation */
if( isUiCmd ){
#if !defined(__DARWIN__) && !defined(__APPLE__) && !defined(__HAIKU__)
zBrowser = db_get("web-browser", 0);
if( zBrowser==0 ){
+ fprintf(stderr, "cmd_webserver()::zBrowser==0\n");
static const char *const azBrowserProg[] =
{ "xdg-open", "gnome-open", "firefox", "google-chrome" };
int i;
zBrowser = "echo";
for(i=0; i
signature.asc
Description: PGP signature
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users