Er, fix next and previous session functions to actually work, part 2.

This commit is contained in:
Nicholas Marriott 2011-01-13 02:08:14 +00:00
parent 588ebb5393
commit 2d82567070

View File

@ -181,7 +181,7 @@ session_next_session(struct session *s)
if (RB_EMPTY(&sessions) || !session_alive(s)) if (RB_EMPTY(&sessions) || !session_alive(s))
return (NULL); return (NULL);
s2 = RB_NEXT(sessions, &sessions, s2); s2 = RB_NEXT(sessions, &sessions, s);
if (s2 == NULL) if (s2 == NULL)
s2 = RB_MIN(sessions, &sessions); s2 = RB_MIN(sessions, &sessions);
if (s2 == s) if (s2 == s)
@ -198,7 +198,7 @@ session_previous_session(struct session *s)
if (RB_EMPTY(&sessions) || !session_alive(s)) if (RB_EMPTY(&sessions) || !session_alive(s))
return (NULL); return (NULL);
s2 = RB_PREV(sessions, &sessions, s2); s2 = RB_PREV(sessions, &sessions, s);
if (s2 == NULL) if (s2 == NULL)
s2 = RB_MAX(sessions, &sessions); s2 = RB_MAX(sessions, &sessions);
if (s2 == s) if (s2 == s)