Fossil SCM

Resolved display cookie diff setting inconsistency reported in [forum:/forumpost/f7e18f946b | forum post f7e18f946b].

stephan 2021-03-19 16:01 trunk
Commit e378f9300e9da364546556107f4c2ad13944d165492c82e6384bd2302bc094a4
1 file changed +2 -1
+2 -1
--- src/info.c
+++ src/info.c
@@ -1662,11 +1662,12 @@
16621662
** * The "preferred-diff-type" setting
16631663
** * 1 for mobile and 2 for desktop, based on the UserAgent
16641664
*/
16651665
int preferred_diff_type(void){
16661666
int dflt;
1667
- char zDflt[2];
1667
+ static char zDflt[2]
1668
+ /*static b/c cookie_link_parameter() does not copy it!*/;
16681669
dflt = db_get_int("preferred-diff-type",-99);
16691670
if( dflt<=0 ) dflt = user_agent_is_likely_mobile() ? 1 : 2;
16701671
zDflt[0] = dflt + '0';
16711672
zDflt[1] = 0;
16721673
cookie_link_parameter("diff","diff", zDflt);
16731674
--- src/info.c
+++ src/info.c
@@ -1662,11 +1662,12 @@
1662 ** * The "preferred-diff-type" setting
1663 ** * 1 for mobile and 2 for desktop, based on the UserAgent
1664 */
1665 int preferred_diff_type(void){
1666 int dflt;
1667 char zDflt[2];
 
1668 dflt = db_get_int("preferred-diff-type",-99);
1669 if( dflt<=0 ) dflt = user_agent_is_likely_mobile() ? 1 : 2;
1670 zDflt[0] = dflt + '0';
1671 zDflt[1] = 0;
1672 cookie_link_parameter("diff","diff", zDflt);
1673
--- src/info.c
+++ src/info.c
@@ -1662,11 +1662,12 @@
1662 ** * The "preferred-diff-type" setting
1663 ** * 1 for mobile and 2 for desktop, based on the UserAgent
1664 */
1665 int preferred_diff_type(void){
1666 int dflt;
1667 static char zDflt[2]
1668 /*static b/c cookie_link_parameter() does not copy it!*/;
1669 dflt = db_get_int("preferred-diff-type",-99);
1670 if( dflt<=0 ) dflt = user_agent_is_likely_mobile() ? 1 : 2;
1671 zDflt[0] = dflt + '0';
1672 zDflt[1] = 0;
1673 cookie_link_parameter("diff","diff", zDflt);
1674

Keyboard Shortcuts

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