File 0562-Fix-crash-in-string-printing.patch of Package erlang

From 8c072f90be4ef35af6a911e4fb8e21aa8c207342 Mon Sep 17 00:00:00 2001
From: Dan Gudmundsson <dgud@erlang.org>
Date: Fri, 27 Mar 2020 12:31:44 +0100
Subject: [PATCH] Fix crash in string printing

Fix to_string/1 to handle all kind of lists.
---
 lib/debugger/src/dbg_wx_win.erl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/debugger/src/dbg_wx_win.erl b/lib/debugger/src/dbg_wx_win.erl
index 4391ad1598..25b76d1739 100644
--- a/lib/debugger/src/dbg_wx_win.erl
+++ b/lib/debugger/src/dbg_wx_win.erl
@@ -304,7 +304,10 @@ to_string(Integer) when is_integer(Integer) ->
     integer_to_list(Integer);
 to_string([]) -> "";
 to_string(List) when is_list(List) ->
-    List;
+    try unicode:characters_to_list(List)
+    catch _:_ ->
+            io_lib:format("~tp",[List])
+    end;
 to_string(Term) ->
     io_lib:format("~tp",[Term]).
 
-- 
2.16.4

openSUSE Build Service is sponsored by