From 5dc68d27d1e979147642d4682044751f029b817c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 13 Oct 1996 03:19:51 +0000 Subject: Fixes for UIDL and Kerberos problems. svn path=/trunk/; revision=319 --- uid.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'uid.c') diff --git a/uid.c b/uid.c index eb87d4dc..186d4b35 100644 --- a/uid.c +++ b/uid.c @@ -140,7 +140,7 @@ int uid_in_list(idl, str) struct idlist **idl; char *str; { - if (*idl == (struct idlist *)NULL) + if (*idl == (struct idlist *)NULL || str == (char *) NULL) return(0); else if (strcmp(str, (*idl)->id) == 0) return(1); @@ -148,6 +148,19 @@ char *str; return(uid_in_list(&(*idl)->next, str)); } +char *uid_find(idl, number) +/* return the id of the given number in the given list. */ +struct idlist **idl; +int number; +{ + if (*idl == (struct idlist *) 0) + return((char *) 0); + else if (number == (*idl)->num) + return((*idl)->id); + else + return(uid_find(&(*idl)->next, number)); +} + int delete_uid(idl, num) /* delete given message from given list */ struct idlist **idl; @@ -175,6 +188,7 @@ struct hostrec *hostp; { free_uid_list(&hostp->oldsaved); hostp->oldsaved = hostp->newsaved; + hostp->newsaved = (struct idlist *) NULL; } void write_saved_lists(hostlist, idfile) -- cgit v1.2.3