diff --git a/cv5/a_train.c b/cv5/a_train.c index 5a6bb76..2ee7397 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -80,18 +80,8 @@ struct car* clear_train(struct car* first, const char* target) { else{ struct car* this = first; - while(this!= NULL){ - //while(this != NULL){ - int x = strcmp(this->next->value, target); - if(x == 0){ - struct car* temp = this->next->next; - this->next = NULL; - this->next = temp; - return this; - } - this = this->next; - //} - /*int x = strcmp(this->value, target); + while(this->next!= NULL){ + int x = strcmp(this->value, target); if(x == 0){ struct car* curr = first; struct car* prev = NULL; @@ -108,7 +98,7 @@ struct car* clear_train(struct car* first, const char* target) { prev->next = curr->next; free(this); } - this = this->next;*/ + this = this->next; } } return first;