diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | src/users.c | 33 | ||||
-rw-r--r-- | version.log | 6 |
3 files changed, 25 insertions, 15 deletions
@@ -15,6 +15,7 @@ Anope Version S V N 08/11 F CAPAB tokens for InspIRCd 1.1 never parsed. [#742] 08/21 F Updated the WIN32.txt document a bit [ #00] 08/21 F Re-worded the CHAN_LEVELS_XOP string in en_us [ #00] +08/27 F Functions firstuser and first_uid now don't collide when used. [#764] Anope Version 1.7.19 -------------------- diff --git a/src/users.c b/src/users.c index f97638662..c6fb4c1cf 100644 --- a/src/users.c +++ b/src/users.c @@ -350,6 +350,7 @@ static int next_index; User *firstuser(void) { next_index = 0; + current = NULL; while (next_index < 1024 && current == NULL) current = userlist[next_index++]; if (debug) @@ -395,34 +396,38 @@ User *find_byuid(const char *uid) return NULL; } +static User *current_uid; +static int next_index_uid; + User *first_uid(void) { - next_index = 0; - while (next_index < 1024 && current == NULL) { - current = userlist[next_index++]; + next_index_uid = 0; + current_uid = NULL; + while (next_index_uid < 1024 && current_uid == NULL) { + current_uid = userlist[next_index_uid++]; } if (debug >= 2) { alog("debug: first_uid() returning %s %s", - current ? current->nick : "NULL (end of list)", - current ? current->uid : ""); + current_uid ? current_uid->nick : "NULL (end of list)", + current_uid ? current_uid->uid : ""); } - return current; + return current_uid; } User *next_uid(void) { - if (current) - current = current->next; - if (!current && next_index < 1024) { - while (next_index < 1024 && current == NULL) - current = userlist[next_index++]; + if (current_uid) + current_uid = current_uid->next; + if (!current_uid && next_index_uid < 1024) { + while (next_index_uid < 1024 && current_uid == NULL) + current_uid = userlist[next_index_uid++]; } if (debug >= 2) { alog("debug: next_uid() returning %s %s", - current ? current->nick : "NULL (end of list)", - current ? current->uid : ""); + current_uid ? current_uid->nick : "NULL (end of list)", + current_uid ? current_uid->uid : ""); } - return current; + return current_uid; } Uid *new_uid(const char *nick, char *uid) diff --git a/version.log b/version.log index 106da8090..1cacc5377 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="19" VERSION_EXTRA="-svn" -VERSION_BUILD="1273" +VERSION_BUILD="1274" # $Log$ # +# BUILD : 1.7.19 (1274) +# BUGS : 764 +# NOTES : Fixed firstuser/nextuser and first_uid/next_uid using the same globals thus being unable to be used at the same time +# # BUILD : 1.7.19 (1273) # BUGS : # NOTES : Updated src/bin/am to now correctly work with multiversioned repositories as reported by svnversion |