is transitive to avoid undefined behaviour, per:
https://www.qualys.com/2024/01/30/qsort.txt
Submitted by: Kuan-Wei Chiu <visitorckw gmail.com>
Github: closes #500
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1922994 13f79535-47bb-0310-9956-
ffa450edef68
/*
* First, see if either of the entries is for the parent directory.
- * If so, that *always* sorts lower than anything else.
+ * If so, that *always* sorts lower than anything else. The
+ * function must be transitive else behaviour is undefined, although
+ * in no real case should both entries start with a '/'.
*/
+ if ((*e1)->name[0] == '/' && (*e2)->name[0] == '/') {
+ return 0;
+ }
if ((*e1)->name[0] == '/') {
return -1;
}