clear
This commit is contained in:
parent
2230d9d16e
commit
02f66e152a
@ -62,8 +62,9 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
return first;
|
||||
}
|
||||
}
|
||||
|
||||
struct car* prev = first;
|
||||
while(prev->next->next != NULL){
|
||||
while(prev->next->next->next != NULL){
|
||||
int x = strcmp(first->value, target);
|
||||
if(x == 0){
|
||||
prev = first->next;
|
||||
@ -81,7 +82,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
}
|
||||
prev = prev->next;
|
||||
}
|
||||
|
||||
/*
|
||||
if(prev->next->next == NULL) {
|
||||
int x = strcmp(first->value, target);
|
||||
if(x == 0){
|
||||
@ -96,7 +97,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
free(prev->next);
|
||||
prev->next = third;
|
||||
}
|
||||
}
|
||||
} */
|
||||
return first;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user