From af084b449679f59b6ec2e8121c42f14e4532c804 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 25 Aug 2008 22:06:50 +0000 Subject: [PATCH] * fix hickup with the floordiv_expanded setting; the way its now it shouldn't double free anymore; the hash does the freeing now. --- webcit/auth.c | 5 +++-- webcit/roomops.c | 8 +++----- webcit/webcit.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/webcit/auth.c b/webcit/auth.c index ff1350be1..5b92c99bf 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -209,6 +209,7 @@ void display_openid_name_request(char *claimed_id, char *username) { void become_logged_in(char *user, char *pass, char *serv_response) { char buf[SIZ]; + StrBuf *FloorDiv; WC->logged_in = 1; extract_token(WC->wc_fullname, &serv_response[4], 0, '|', sizeof WC->wc_fullname); @@ -232,7 +233,8 @@ void become_logged_in(char *user, char *pass, char *serv_response) get_pref_long("current_iconbar", &WC->current_iconbar, current_iconbar_menu); - get_preference("floordiv_expanded", &WC->floordiv_expanded); + get_preference("floordiv_expanded", &FloorDiv); + WC->floordiv_expanded = FloorDiv; } @@ -553,7 +555,6 @@ void end_webcit_session(void) { if (WC->logged_in) { set_pref_long("current_iconbar", WC->current_iconbar, 0); - set_preference("floordiv_expanded", WC->floordiv_expanded, 1); } serv_puts("QUIT"); diff --git a/webcit/roomops.c b/webcit/roomops.c index 7014040f1..05a0ec4a2 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -3190,11 +3190,9 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) { void set_floordiv_expanded(void) { struct wcsession *WCC = WC; - if (WCC->floordiv_expanded == NULL) - WCC->floordiv_expanded = NewStrBuf(); - else - FlushStrBuf(WC->floordiv_expanded); - StrBufAppendBuf(WC->floordiv_expanded, WC->UrlFragment1, 0); + WCC->floordiv_expanded = NewStrBuf(); + StrBufAppendBuf(WCC->floordiv_expanded, WCC->UrlFragment1, 0); + set_preference("floordiv_expanded", WCC->floordiv_expanded, 1); } /** diff --git a/webcit/webcit.h b/webcit/webcit.h index 41485b8e8..2db42708f 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -476,7 +476,7 @@ struct wcsession { time_t cache_timestamp; /**< ??? todo */ HashList *IconBarSetttings; /**< which icons should be shown / not shown? */ long current_iconbar; /**< What is currently in the iconbar? */ - StrBuf *floordiv_expanded; /**< which floordiv currently expanded */ + const StrBuf *floordiv_expanded; /**< which floordiv currently expanded */ int selected_language; /**< Language selected by user */ time_t last_pager_check; /**< last time we polled for instant msgs */ int nonce; /**< session nonce (to prevent session riding) */ -- 2.39.2