any collection. Should make it clearer what's going on if something
believes the answer and crashes.
track_to_words() now includes a bodge for such tracks to avoid a
crash. Ultimately the answer is to expunge such tracks from the
database but while my db is in a bizarre state it's worth making the
code a bit more robust.
&& track[l] == '/')
break;
}
&& track[l] == '/')
break;
}
- if(n >= config->collection.n) return 0;
+ if(n >= config->collection.n) {
+ error(0, "found track in no collection '%s'", track);
+ return 0;
+ }
return config->collection.s[n].root;
}
return config->collection.s[n].root;
}
struct vector v;
char **w;
int nw;
struct vector v;
char **w;
int nw;
+ const char *rootless = track_rootless(track);
+ if(!rootless)
+ rootless = track; /* bodge */
- if((w = words(casefold(strip_extension(track_rootless(track))), &nw)))
+ if((w = words(casefold(strip_extension(rootless)), &nw)))
vector_append_many(&v, w, nw);
for(; p; p = p->next)
vector_append_many(&v, w, nw);
for(; p; p = p->next)