1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
|
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
|
-
+
-
+
|
/*
** Return true if the string zVal represents "true" (or "false").
*/
int is_truth(const char *zVal){
static const char *azOn[] = { "on", "yes", "true", "1" };
int i;
for(i=0; i<sizeof(azOn)/sizeof(azOn[0]); i++){
if( strcmp(zVal,azOn[i])==0 ) return 1;
if( fossil_strcmp(zVal,azOn[i])==0 ) return 1;
}
return 0;
}
int is_false(const char *zVal){
static const char *azOff[] = { "off", "no", "false", "0" };
int i;
for(i=0; i<sizeof(azOff)/sizeof(azOff[0]); i++){
if( strcmp(zVal,azOff[i])==0 ) return 1;
if( fossil_strcmp(zVal,azOff[i])==0 ) return 1;
}
return 0;
}
/*
** Swap the g.db and g.dbConfig connections so that the various db_* routines
** work on the ~/.fossil database instead of on the repository database.
|
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
|
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
|
-
+
|
int n = strlen(zName);
for(i=0; ctrlSettings[i].name; i++){
if( strncmp(ctrlSettings[i].name, zName, n)==0 ) break;
}
if( !ctrlSettings[i].name ){
fossil_fatal("no such setting: %s", zName);
}
isManifest = strcmp(ctrlSettings[i].name, "manifest")==0;
isManifest = fossil_strcmp(ctrlSettings[i].name, "manifest")==0;
if( isManifest && globalFlag ){
fossil_fatal("cannot set 'manifest' globally");
}
if( unsetFlag ){
db_unset(ctrlSettings[i].name, globalFlag);
}else if( g.argc==4 ){
db_set(ctrlSettings[i].name, g.argv[3], globalFlag);
|