Double Linked Lists

Hello Guys. Im new here and kinda new in programming.

I have to face a double linked list problem and I would like you to help me

Well lets say that I have this struct

struct abEntry{
int am;
char lname[20];
char fname[30];
char email[20];
struct abEntry *next;
struct abEntry *prev;
};

and the function to add a new struct is

struct abEntry *getAbEntry(struct abEntry *pointer,struct abEntry abed)
{
struct abEntry *temp=pointer;
struct abEntry *temp2;
printf("\n*****Insert an AbEntry*****\n");
if (pointer!= NULL) {
temp2=pointer;
while (pointer->next !=NULL)
pointer=pointer->next;
pointer->next=(struct abEntry *)malloc(sizeof(struct abEntry));
printf("Type last name:");
scanf("%s",abed.lname);
printf("Type first name:");
scanf("%s",abed.fname);
printf("Type AM:");
scanf("%d",&(abed.am));
printf("Type E-Mail:");
scanf("%s",abed.email);
pointer->prev=temp2;
pointer->am=abed.am;
memcpy(pointer->fname,&abed.fname,30);
memcpy(pointer->lname,&abed.lname,20);
memcpy(pointer->email,&abed.email,20);
return temp;
}
else{
pointer=(struct abEntry *)malloc(sizeof(struct abEntry));
pointer->next=NULL;
printf("Type last name:");
scanf("%s",abed.lname);
printf("Type first name:");
scanf("%s",abed.fname);
printf("Type AM:");
scanf("%d",&(abed.am));
printf("Type E-Mail:");
scanf("%s",abed.email);
pointer->am=abed.am;
memcpy(pointer->fname,&abed.fname,30);
memcpy(pointer->lname,&abed.lname,20);
memcpy(pointer->email,&abed.email,20);
return pointer;
}
}

I have also the DISPLAY function which is suposed to show me all the entries I have done since i started the programm

The Function is

void Display(struct abEntry *pointer)
{
if ( pointer==NULL){
printf ( "I lista einai adeia mpinta,arxidi,pousti,xekwliari\n\n");
printf ( "grapse kanena stoixeio re mounopano prin patiseis display\n\n");
}
else
while (pointer!=NULL)
{
printf("%s\n",pointer->fname);
printf("%s\n",pointer->lname);
printf("%d\n",pointer->am);
printf("%s\n",pointer->email);

pointer=pointer->prev;

}
printf("\n");
}

But it only displays the last entry and not the others

Can you please help me find the mistake?

Thanks a lot
[3132 byte] By [Hwoarang] at [2007-11-20 2:45:26]