stringsorter: Fix one case of collation handling

When not ignoring case, and not collating, we were
returning sort keys that were already freed. Oops.

Pointed out by clang.
This commit is contained in:
Matthias Clasen 2022-11-17 23:52:35 -05:00
parent 8c1a041104
commit 9cbfbbdf39

View File

@ -86,14 +86,20 @@ gtk_string_sorter_get_key (GtkExpression *expression,
switch (collation)
{
case GTK_COLLATION_NONE:
key = s;
if (ignore_case)
key = g_steal_pointer (&s);
else
key = g_strdup (s);
break;
case GTK_COLLATION_UNICODE:
key = g_utf8_collate_key (s, -1);
break;
case GTK_COLLATION_FILENAME:
key = g_utf8_collate_key_for_filename (s, -1);
break;
default:
g_assert_not_reached ();
break;