In empconsole.cpp ExpandShellGlob I changed the scandir function to use alphasort and around line 1230 now reads:
try {
direntrylist.insert(direntrylist.end(), DirectoryEntry(name, full_path.c_str()));
total ++;
// it++;
}
previously the insert had been written like:
try {
direntrylist.insert(it, DirectoryEntry(name, full_path.c_str()));
total ++;
it++;
}
It's not immediately obvious to me why this way would work, (or why that iterator is in there at all, since nothing else except the insert touches it, I don't know that stepping through the list after an insert by incrementing it is the Right Thing To Do since I don't know what value it would take in relation to the list as it is originally set to a value pointing to the end of an empty list, it's not even necessary to use it as the above code demonstrates, and it gets set to different value as soon as ExpandShellGlob is done) while the changes I've made seem to work for me as expected. Unless someone can explain to me why it was written the way it was, I'm going to pretend it was a bug. :)