File 0153-escript-direct-all-io-put_chars-1-calls-to-standard_.patch of Package erlang
From 9f48ebbc0454cf60f9a9808802f755c7d42f9549 Mon Sep 17 00:00:00 2001
From: Mikael Pettersson <mikpelinux@gmail.com>
Date: Sat, 12 Sep 2020 18:31:49 +0200
Subject: [PATCH 3/9] escript: direct all io:put_chars/1 calls to
standard_error
they are all error or warning messages
---
lib/stdlib/src/escript.erl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl
index 50f774c5fc..6d7793a8cd 100644
--- a/lib/stdlib/src/escript.erl
+++ b/lib/stdlib/src/escript.erl
@@ -814,7 +814,7 @@ report_warnings(Ws0) ->
({F,Eds}) -> format_message(F, Eds) end,
Ws0),
Ws = ordsets:from_list(Ws1),
- lists:foreach(fun({_,Str}) -> io:put_chars(Str) end, Ws).
+ lists:foreach(fun({_,Str}) -> io:put_chars(standard_error, Str) end, Ws).
format_message(F, [{Line,Mod,E}|Es]) ->
M = {{F,Line},io_lib:format("~ts:~w: Warning: ~ts\n", [F,Line,Mod:format_error(E)])},
@@ -897,7 +897,7 @@ encoding() ->
put_chars(String) ->
try
- io:put_chars(String)
+ io:put_chars(standard_error, String)
catch
_:_ ->
erlang:display(lists:flatten(String))
--
2.26.2