mirror of
https://github.com/openbsd/src.git
synced 2026-04-30 17:16:30 +00:00
When sorting page names (without section numbers) in the mandoc database,
after sorting by name type in descending order (to put the most important names first), use the same sort order that is conventional in SEE ALSO sections: first case-insensitively in ascending alphabetic order, and if that results in a tie because two names differ only in case (like OSSL_TRACE_END and OSSL_trace_end, which are *different* names that, in FreeBSD, are documented in the same manual page - why am i unsurprised that such madness occurs with "OSSL" of all APIs?), break the tie by sorting case-sensitively in ascending alphabetic order, i.e. put capitals before lowercase letters, rather than allowing the tie to result in a random order. This very minor issue was found by Mark Johnston <markj@> when he worked on reproducible builds in FreeBSD.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* $OpenBSD: dba.c,v 1.7 2017/02/09 18:26:17 schwarze Exp $ */
|
||||
/* $OpenBSD: dba.c,v 1.8 2025/09/24 13:08:34 schwarze Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
|
||||
* Copyright (c) 2016, 2017, 2025 Ingo Schwarze <schwarze@openbsd.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -310,7 +310,8 @@ compare_names(const void *vp1, const void *vp2)
|
||||
cp1 = *(const char * const *)vp1;
|
||||
cp2 = *(const char * const *)vp2;
|
||||
return (diff = *cp2 - *cp1) ? diff :
|
||||
strcasecmp(cp1 + 1, cp2 + 1);
|
||||
(diff = strcasecmp(cp1 + 1, cp2 + 1)) ? diff :
|
||||
strcmp(cp1 + 1, cp2 + 1);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user