aboutsummaryrefslogtreecommitdiffstats
path: root/uid.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-11-28 17:42:08 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-11-28 17:42:08 +0000
commit7f52702a7fd4711e863af33beee1f370e4eccdbf (patch)
tree91d5131811cea671a8a06371152ec32e905cb8d5 /uid.c
parent148d6bd667c1b414e9620fcaafe6cc77603cde5f (diff)
downloadfetchmail-7f52702a7fd4711e863af33beee1f370e4eccdbf.tar.gz
fetchmail-7f52702a7fd4711e863af33beee1f370e4eccdbf.tar.bz2
fetchmail-7f52702a7fd4711e863af33beee1f370e4eccdbf.zip
Abolish servername mamber, go to servernames list.
svn path=/trunk/; revision=582
Diffstat (limited to 'uid.c')
-rw-r--r--uid.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/uid.c b/uid.c
index 8797c299..15a06ba3 100644
--- a/uid.c
+++ b/uid.c
@@ -84,7 +84,7 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
{
for (ctl = hostlist; ctl; ctl = ctl->next)
{
- if (strcmp(host, ctl->servername) == 0
+ if (strcmp(host, ctl->servernames->id) == 0
&& strcmp(user, ctl->remotename) == 0)
{
save_uid(&ctl->oldsaved, -1, id);
@@ -104,15 +104,18 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
struct idlist *save_uid(struct idlist **idl, int num, const char *str)
/* save a number/UID pair on the given UID list */
{
- struct idlist *new;
+ struct idlist **end;
- new = (struct idlist *)xmalloc(sizeof(struct idlist));
- new->val.num = num;
- new->id = xstrdup(str);
- new->next = *idl;
- *idl = new;
+ /* do it nonrecursively so the list is in the right order */
+ for (end = idl; *end; end = &(*end)->next)
+ continue;
+
+ *end = (struct idlist *)xmalloc(sizeof(struct idlist));
+ (*end)->val.num = num;
+ (*end)->id = xstrdup(str);
+ (*end)->next = NULL;
- return(new);
+ return(*end);
}
void free_uid_list(struct idlist **idl)
@@ -251,7 +254,7 @@ void write_saved_lists(struct query *hostlist, const char *idfile)
for (ctl = hostlist; ctl; ctl = ctl->next) {
for (idp = ctl->oldsaved; idp; idp = idp->next)
fprintf(tmpfp, "%s@%s %s\n",
- ctl->remotename, ctl->servername, idp->id);
+ ctl->remotename, ctl->servernames->id, idp->id);
}
for (idp = scratchlist; idp; idp = idp->next)
fputs(idp->id, tmpfp);