diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-28 17:42:08 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-28 17:42:08 +0000 |
commit | 7f52702a7fd4711e863af33beee1f370e4eccdbf (patch) | |
tree | 91d5131811cea671a8a06371152ec32e905cb8d5 /uid.c | |
parent | 148d6bd667c1b414e9620fcaafe6cc77603cde5f (diff) | |
download | fetchmail-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.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -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); |