From 17134b3a02bc8a251b6279c15ae8a58a5bb5eb03 Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Sat, 16 Jul 2005 20:25:58 +0000 Subject: [project @ 2005-07-16 20:25:58 by adrianl] Allow login with new user/password if entered incorrectly. svn path=/import/netsurf/; revision=1800 --- desktop/loginlist.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'desktop/loginlist.c') diff --git a/desktop/loginlist.c b/desktop/loginlist.c index 3702953c6..ca5ab7ea8 100644 --- a/desktop/loginlist.c +++ b/desktop/loginlist.c @@ -84,10 +84,13 @@ void login_list_add(char *host, char* logindets) warn_user("NoMemory", 0); return; } - nli->prev = loginlist->prev; - nli->next = loginlist; - loginlist->prev->next = nli; - loginlist->prev = nli; + + /* prepend to list so that more recent additions are + encountered first in login_list_get */ + nli->next = loginlist->next; + nli->prev = loginlist; + loginlist->next->prev = nli; + loginlist->next = nli; LOG(("Adding %s", temp)); #ifndef NDEBUG @@ -149,9 +152,9 @@ struct login *login_list_get(char *url) do { LOG(("%s, %d", temp, strlen(temp))); - for (nli = loginlist->next; nli != loginlist && - (strcasecmp(nli->host, temp)!=0); - nli = nli->next) + for (nli = loginlist->next; nli != loginlist && + (strcasecmp(nli->host, temp)!=0); + nli = nli->next) /* do nothing */; if (nli != loginlist) { -- cgit v1.2.3