sorting a double linked list
I've attempted to sort a double linked list, alphabetically by its member 'name' which is a character string, and it doesn't seem to work. It either goes into an endless loop, or it sorts them around, and puts em back in their original order. I used a typical bubble sort, and it worked fine in an array of character strings, but I suppose it doesn't work well for a linked list.
Heres the code I used:
Could someone please enlighten me on a way that will actually work? Or tell me if I made a stupid mistake? Thanks.
COMMAND_DATA *cmd, *cmd2, *temp;