Hi Kamil, > New version of filevercmp.c is attached, now without copying of the input > strings. I've also made a simple performance test - the speed was about 7-8x > slower than original glibc strverscmp function, but the glibc's result is > mostly wrong.
If you didn't get feedback from Jim, here's mine. Thanks for the revised version. Indeed speed matters less than correctness. First get the results right, then only think about optimization. For a use in 'ls', the time of the system calls to get the filenames will be much larger than the time to sort the list of filenames. (Btw, the doc of the mpsort function could mention that it is O(N log N) worst case.) > There was something like "Copyright (C) 1995 Ian Jackson" in original file, > but also "... under terms of GNU General Public License..." I am not lawyer > and don't understand such details :-) So it's not copyrighted by the FSF? Well, then the best thing to do, IMO, is to provide a clean room reimplementation of this function under FSF copyright. (We want all of gnulib to be owned by the FSF, because so many projects use gnulib.) Can you give a complete and precise description of the result that verrevcmp produces, precise enough that anyone on this list can implement a function that behaves identically, but without detailing the implementation itself? Bruno