On 15.07.20 17:14, Alan DeKok wrote:
On Jul 15, 2020, at 8:19 AM, Sven Hartge <sven@svenhartge.de> wrote:
And in the end the load order should be fixed by sorting before loading to make it stable for everyone and not break semi-randomly based on the way a filesystem presents/stores the entries in a directory.
As alway, patches are welcome.
OK, please see the attached diff. Please note that I have no idea what I am doing, this may be memleaky as hell (although I think I added the free(namelist) to the correct places) and is not tested in any way. I just adapted the example code from the scandir(3) man-page and massaged it a bit to fit the existing code. Also note: if one uses scandir one could technically use its own filter to remove '.' and '..' from the list of entries but I wanted to change to be as minimal as possible. Grüße, Sven.