On Nov 9, 2007 5:13 AM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
Hm. What about alpm_list_remove_node?
I believe I snuck your thing in there too, assuming I understood it correctly:
You stated that alpm_list_remove, when removing ALL items from a list only returned the last found data pointer. I adjusted the remove function to only remove the first item.
No. I meant that removing the first node with alpm_list_remove_node will create a "->next circle" now, because node->prev always != NULL.
I don't know what you're talking about. That sentence makes no sense. At the very least please point to some code or something. Please stop doing this, it's annoying. At the very least give us freaking line numbers - I thought i talked to you about this? If you don't understand me, please try to simulate/think of _without any help_: what happens, if you want to remove the first node of a list with alpm_list_remove_node()... If you managed to do it, you will understand that sentence;-) (Hint: node->prev points to the tail in that case)
Some more issues: 1. You simply forgot about resetting the tail pointer when you remove the last element with alpm_list_remove. 2. As I see, alpm_list_remove_node is used nowhere in the code, and dangerous (when you remove the first or last node, "interesting" things can happen); so that should be removed. Bye