This is a "shouldn't happen" case, so I have added an assert
to quell the warning, and catch the failure in the off chance
we do get here with last == NULL.
/* If we're fnext, we haven't checked the last node yet. If it's the
* current folder, return the first node. */
- if (run_mode == FNEXT && strcmp(last->n_name, cur) == 0) {
- return first;
+ if (run_mode == FNEXT) {
+ assert(last != NULL);
+ if (strcmp(last->n_name, cur) == 0) {
+ return first;
+ }
}
if (run_mode == NEW) {