summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-08-27 18:12:31 +0000
committergeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-08-27 18:12:31 +0000
commit1576ab143b15ce52c5f83f1122b47730512e59e7 (patch)
treeebf76beb17e1ea0adf6aab2055c5f5a75ba499c5
parentf9f5c677cc5615730e137b9dcf78f8887028f2c8 (diff)
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
git-svn-id: svn://svn.anope.org/anope/trunk@1274 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@992 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rw-r--r--src/users.c33
-rw-r--r--version.log6
3 files changed, 25 insertions, 15 deletions
diff --git a/Changes b/Changes
index e58378c0d..6413fc510 100644
--- a/Changes
+++ b/Changes
@@ -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