Fossil SCM

Fix to previous for the "non-constant format" complaint from some compilers. I can't see what they're yelling about, but this fixes it.

wyoung 2018-11-09 19:11 login-on-post
Commit 095333fc603f655af1c65e7159113321184689fdeb41d6dc21a707272de2f112
1 file changed +7 -3
+7 -3
--- src/forum.c
+++ src/forum.c
@@ -971,13 +971,17 @@
971971
if( !g.perm.RdForum ){
972972
login_needed(g.anon.RdForum);
973973
return;
974974
}
975975
style_header("Forum");
976
- style_submenu_element("New Thread", g.perm.WrForum ?
977
- "%R/forumnew" :
978
- "%R/login");
976
+ {
977
+ /* 2-step split required by some GCCs, which think this first
978
+ * expression "has non-constant format". Whatever GCC...
979
+ */
980
+ const char* target = g.perm.WrForum ? "%R/forumnew" : "%R/login";
981
+ style_submenu_element("New Thread", target);
982
+ }
979983
if( g.perm.ModForum && moderation_needed() ){
980984
style_submenu_element("Moderation Requests", "%R/modreq");
981985
}
982986
if( (srchFlags & SRCH_FORUM)!=0 ){
983987
if( search_screen(SRCH_FORUM, 0) ){
984988
--- src/forum.c
+++ src/forum.c
@@ -971,13 +971,17 @@
971 if( !g.perm.RdForum ){
972 login_needed(g.anon.RdForum);
973 return;
974 }
975 style_header("Forum");
976 style_submenu_element("New Thread", g.perm.WrForum ?
977 "%R/forumnew" :
978 "%R/login");
 
 
 
 
979 if( g.perm.ModForum && moderation_needed() ){
980 style_submenu_element("Moderation Requests", "%R/modreq");
981 }
982 if( (srchFlags & SRCH_FORUM)!=0 ){
983 if( search_screen(SRCH_FORUM, 0) ){
984
--- src/forum.c
+++ src/forum.c
@@ -971,13 +971,17 @@
971 if( !g.perm.RdForum ){
972 login_needed(g.anon.RdForum);
973 return;
974 }
975 style_header("Forum");
976 {
977 /* 2-step split required by some GCCs, which think this first
978 * expression "has non-constant format". Whatever GCC...
979 */
980 const char* target = g.perm.WrForum ? "%R/forumnew" : "%R/login";
981 style_submenu_element("New Thread", target);
982 }
983 if( g.perm.ModForum && moderation_needed() ){
984 style_submenu_element("Moderation Requests", "%R/modreq");
985 }
986 if( (srchFlags & SRCH_FORUM)!=0 ){
987 if( search_screen(SRCH_FORUM, 0) ){
988

Keyboard Shortcuts

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