File 0617-stdlib-edlin_expand-should-not-crash-when-trying-to-.patch of Package erlang

From 1d89ae33c3889870bf56be2281fbf8126f0f6fd3 Mon Sep 17 00:00:00 2001
From: Fredrik Frantzen <frazze@erlang.org>
Date: Mon, 2 Jun 2025 09:55:02 +0200
Subject: [PATCH 1/2] stdlib: edlin_expand should not crash when trying to
 complete a map

if you have a map that does not have atom keys, shell should not
crash when you try to expand.
---
 lib/stdlib/src/edlin_expand.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl
index 70c41fe8d2..ae0c138c15 100644
--- a/lib/stdlib/src/edlin_expand.erl
+++ b/lib/stdlib/src/edlin_expand.erl
@@ -251,7 +251,7 @@ expand_map(_, [], _, _) ->
 expand_map(Word, Bs, Binding, Keys) ->
     case proplists:get_value(list_to_atom(Binding), Bs) of
         Map when is_map(Map) ->
-            K1 = sets:from_list(maps:keys(Map)),
+            K1 = sets:from_list([Key || Key <- maps:keys(Map), is_atom(Key)]),
             K2 = sets:subtract(K1, sets:from_list([list_to_atom(K) || K <- Keys])),
             match(Word, sets:to_list(K2), "=>");
         _ -> {no, [], []}
-- 
2.43.0

openSUSE Build Service is sponsored by