Fixed console and made commands typed there work

This commit is contained in:
2003-10-20 13:31:30 -04:00
parent 4c6f5dfb15
commit 1685e64676
13 changed files with 411 additions and 296 deletions

View File

@@ -179,28 +179,29 @@ void list<ItemType>::Remove(ItemType target)
if(head != NULL)
{
listNode<ItemType>* temp = head;
tail->next = head;
listNode<ItemType>* temp2 = head;
while(temp->next != NULL && temp->data != target)
{
tail->next = temp;
temp2 = temp;
temp = temp->next;
}
if(temp->data == target)
{
if(tail->next != head)
if(temp != head)
{
tail->next->next = temp->next;
temp2->next = temp->next;
delete temp;
}
else
{
if(tail == head)
tail = NULL;
head = head->next;
delete tail->next;
delete temp2;
}
}
tail->next = NULL;
}
}