]> Pileus Git - ~andy/fetchmail/commitdiff
Make copying work.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 14 Mar 2000 06:58:56 +0000 (06:58 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 14 Mar 2000 06:58:56 +0000 (06:58 -0000)
svn path=/trunk/; revision=2828

fetchmail.c
uid.c

index 3cd8c0d693b639ff179a58560ca5e1819fad1786..0deb0598f70f4c6265c917e6551395da56dc2f09 100644 (file)
@@ -759,15 +759,14 @@ int main(int argc, char **argv)
 static void list_merge(struct idlist **dstl, struct idlist **srcl, int force)
 {
     /*
-     * If force is off, modify h2 fields only when they're empty (treat h1
-     * as defaults).  If force is on, modify each h2 field whenever h1
-     * is nonempty (treat h1 as an override).  
+     * If force is off, modify dstl fields only when they're empty (treat srcl
+     * as defaults).  If force is on, modify each dstl field whenever scrcl
+     * is nonempty (treat srcl as an override).  
      */
-    if (force ? !!srcl : !dstl)
+    if (force ? !!*srcl : !*dstl)
     {
        struct idlist *cpl = copy_str_list(*srcl);
 
-       free_str_list(dstl);
        append_str_list(dstl, &cpl);
     }
 }
diff --git a/uid.c b/uid.c
index 453274b795cfcced565fbcb68737efcfc7b9f3bd..cf8a008b51faf602213269f26599979aa75a7f8a 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -394,6 +394,7 @@ struct idlist *copy_str_list(struct idlist *idl)
     else
     {
        newnode = (struct idlist *)xmalloc(sizeof(struct idlist));
+       memcpy(newnode, idl, sizeof(struct idlist));
        newnode->next = copy_str_list(idl->next);
        return(newnode);
     }