Revision b21f68b4 nest/password.c

View differences:

nest/password.c
14 14
struct password_item *last_password_item = NULL;
15 15

  
16 16
struct password_item *
17
password_find(list *l)
17
password_find(list *l, int first_fit)
18 18
{
19 19
  struct password_item *pi;
20
  struct password_item *pf = NULL;
20 21

  
21 22
  if (l)
22 23
  {
23 24
    WALK_LIST(pi, *l)
24 25
    {
25 26
      if ((pi->genfrom < now_real) && (pi->gento > now_real))
26
        return pi;
27
      {
28
	if (first_fit)
29
	  return pi;
30

  
31
	if (!pf || pf->genfrom < pi->genfrom)
32
	  pf = pi;
33
      }
27 34
    }
28 35
  }
29
  return NULL;
36
  return pf;
30 37
}
31 38

  
32 39
void password_cpy(char *dst, char *src, int size)

Also available in: Unified diff