summaryrefslogtreecommitdiffstats
path: root/nest/password.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/password.c')
-rw-r--r--nest/password.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/nest/password.c b/nest/password.c
index 80c4c7b..179939e 100644
--- a/nest/password.c
+++ b/nest/password.c
@@ -14,19 +14,26 @@
struct password_item *last_password_item = NULL;
struct password_item *
-password_find(list *l)
+password_find(list *l, int first_fit)
{
struct password_item *pi;
+ struct password_item *pf = NULL;
if (l)
{
WALK_LIST(pi, *l)
{
if ((pi->genfrom < now_real) && (pi->gento > now_real))
- return pi;
+ {
+ if (first_fit)
+ return pi;
+
+ if (!pf || pf->genfrom < pi->genfrom)
+ pf = pi;
+ }
}
}
- return NULL;
+ return pf;
}
void password_cpy(char *dst, char *src, int size)