From 60ff3ef7645d2a8b34717732afb095621be5b991 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 26 Mar 2021 17:18:23 +0100 Subject: [PATCH] Work around ffado port-name idiosyncrasies --- libs/pbd/pbd/natsort.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/pbd/pbd/natsort.h b/libs/pbd/pbd/natsort.h index c3a24546a1..bd03b555a4 100644 --- a/libs/pbd/pbd/natsort.h +++ b/libs/pbd/pbd/natsort.h @@ -136,6 +136,15 @@ naturally_less (const char* a, const char* b) if (*a == *b) { continue; } +#if 1 + /* treat underscore as space, this works around idiosyncratic + * ffado port-names: "foo_in", "foo0_in", "foo2_in", etc */ + if (*a == '_') { + return ' ' < *b; + } else if (*b == '_') { + return *a < ' '; + } else +#endif return *a < *b; }