Fossil SCM

Only call db_get_do_versionable() after checking that it's a boolean versionable setting.

jan.nijtmans 2013-05-07 13:03 trunk
Commit a60df3be4468a3d6a5ae0cfc6a55c48793ec2549
1 file changed +2 -1
+2 -1
--- src/setup.c
+++ src/setup.c
@@ -1209,12 +1209,13 @@
12091209
@ the meaning of each setting.</p><hr />
12101210
@ <form action="%s(g.zTop)/setup_settings" method="post"><div>
12111211
@ <table border="0"><tr><td valign="top">
12121212
login_insert_csrf_secret();
12131213
for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1214
- int hasVersionableValue = db_get_do_versionable(pSet->name, NULL)!=0;
12151214
if( pSet->width==0 ){
1215
+ int hasVersionableValue = pSet->versionable &&
1216
+ (db_get_do_versionable(pSet->name, NULL)!=0);
12161217
onoff_attribute(pSet->name, pSet->name,
12171218
pSet->var!=0 ? pSet->var : pSet->name,
12181219
is_truth(pSet->def), hasVersionableValue);
12191220
if( pSet->versionable ){
12201221
@ (v)<br />
12211222
--- src/setup.c
+++ src/setup.c
@@ -1209,12 +1209,13 @@
1209 @ the meaning of each setting.</p><hr />
1210 @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
1211 @ <table border="0"><tr><td valign="top">
1212 login_insert_csrf_secret();
1213 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
1214 int hasVersionableValue = db_get_do_versionable(pSet->name, NULL)!=0;
1215 if( pSet->width==0 ){
 
 
1216 onoff_attribute(pSet->name, pSet->name,
1217 pSet->var!=0 ? pSet->var : pSet->name,
1218 is_truth(pSet->def), hasVersionableValue);
1219 if( pSet->versionable ){
1220 @ (v)<br />
1221
--- src/setup.c
+++ src/setup.c
@@ -1209,12 +1209,13 @@
1209 @ the meaning of each setting.</p><hr />
1210 @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
1211 @ <table border="0"><tr><td valign="top">
1212 login_insert_csrf_secret();
1213 for(pSet=ctrlSettings; pSet->name!=0; pSet++){
 
1214 if( pSet->width==0 ){
1215 int hasVersionableValue = pSet->versionable &&
1216 (db_get_do_versionable(pSet->name, NULL)!=0);
1217 onoff_attribute(pSet->name, pSet->name,
1218 pSet->var!=0 ? pSet->var : pSet->name,
1219 is_truth(pSet->def), hasVersionableValue);
1220 if( pSet->versionable ){
1221 @ (v)<br />
1222

Keyboard Shortcuts

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