clear
This commit is contained in:
parent
535859a615
commit
a8b4648778
@ -80,16 +80,14 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
|
|
||||||
else{
|
else{
|
||||||
struct car* this = first;
|
struct car* this = first;
|
||||||
while(this != NULL){
|
while(this->next != NULL){
|
||||||
//while(this != NULL){
|
//while(this != NULL){
|
||||||
int x = strcmp(this->value, target);
|
int x = strcmp(this->next->value, target);
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
first = this->next;
|
struct car* temp = this->next->next;
|
||||||
free(this);
|
|
||||||
this->next = NULL;
|
this->next = NULL;
|
||||||
//free(this->next);
|
this->next = temp;
|
||||||
|
return this;
|
||||||
return first;
|
|
||||||
}
|
}
|
||||||
this = this->next;
|
this = this->next;
|
||||||
//}
|
//}
|
||||||
|
Loading…
Reference in New Issue
Block a user