After spending some time looking at the existing code, I find that it's not that far off from working properly. It correctly allows for multiple options to be specified on the command line, and correctly handles the exclusive options (i.e. of /N, /E, /S, /T, it correctly allows only one of these to take effect). What it gets wrong is that in Windows, the first of the exclusive options encountered takes precedence, where in current Wine code, it's the last exclusive option encountered that takes precedence. Current wine code also does not sort directory names for /G.
All that in mind, the code does not need to be changed to allow multiple sort options to be passed to the qsort algorithm. We could clean up the use of global variables a bit, and sort the directory names for /G.