clear
This commit is contained in:
parent
4050454880
commit
468b37d1be
@ -72,13 +72,12 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
|
||||
}
|
||||
x = strcmp(prev->next->value, target);
|
||||
// if(x == 0){
|
||||
/* if(first->next->next == NULL) {
|
||||
//struct car* tmp = prev->next;
|
||||
if(x == 0){
|
||||
struct car* third = prev->next->next;
|
||||
free(prev->next);
|
||||
prev->next = NULL;
|
||||
}*/
|
||||
//}
|
||||
prev->next = third;
|
||||
|
||||
}
|
||||
prev = prev->next;
|
||||
}
|
||||
if(prev->next->next == NULL) {
|
||||
@ -89,6 +88,13 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
return prev;
|
||||
|
||||
}
|
||||
x = strcmp(prev->next->value, target);
|
||||
if(x == 0){
|
||||
struct car* third = prev->next->next;
|
||||
free(prev->next);
|
||||
prev->next = third;
|
||||
}
|
||||
|
||||
//free(prev->next);
|
||||
//prev->next = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user