From 7b7fb826b33773bab0cb57cc0dc234a9d7a0742e Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 17 Oct 2023 12:15:51 -0400 Subject: stabilize config sort --- ted.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ted.c b/ted.c index fc54a93..85e1a0b 100644 --- a/ted.c +++ b/ted.c @@ -220,12 +220,14 @@ char *ted_get_root_dir(Ted *ted) { static int applicable_configs_cmp(void *context, const void *av, const void *bv) { const Config *const all_configs = context; - const u32 *ai = av, *bi = bv; - const Config *ac = &all_configs[*ai], *bc = &all_configs[*bi]; + const u32 ai = *(const u32 *)av, bi = *(const u32 *)bv; + const Config *ac = &all_configs[ai], *bc = &all_configs[bi]; const i32 a = config_priority(ac); const i32 b = config_priority(bc); if (a < b) return -1; if (a > b) return 1; + if (ai < bi) return -1; + if (ai > bi) return 1; return 0; } -- cgit v1.2.3