Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
0376-fixup-stdlib-Fix-io_lib-get_until-to-retur...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0376-fixup-stdlib-Fix-io_lib-get_until-to-return-binaries.patch of Package erlang
From 49e1ae3624815264ba0727927652d3c26ba18967 Mon Sep 17 00:00:00 2001 From: Lukas Larsson <lukas@erlang.org> Date: Thu, 4 Jan 2024 13:38:24 +0100 Subject: [PATCH 2/2] fixup! stdlib: Fix io_lib:get_until to return binaries at eof --- lib/kernel/src/file_io_server.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/kernel/src/file_io_server.erl b/lib/kernel/src/file_io_server.erl index e257857e5a..569eeb0312 100644 --- a/lib/kernel/src/file_io_server.erl +++ b/lib/kernel/src/file_io_server.erl @@ -679,18 +679,22 @@ get_chars_apply(Mod, Func, XtraArg, S0, OutEnc, error:ErrReason -> {stop,ErrReason,{error,err_func(Mod, Func, XtraArg)},State} end. - + %% A hack that tries to inform the caller about the position where the %% error occurred. -invalid_unicode_error(Mod, Func, XtraArg, S) -> +invalid_unicode_error(Mod = io_lib, Func = get_until, + XtraArg = {erl_scan,tokens,_Args}, + {GetUntilState, S}) + when is_boolean(GetUntilState) -> try - {erl_scan,tokens,_Args} = XtraArg, Location = erl_scan:continuation_location(S), {error,{Location, ?MODULE, invalid_unicode},Location} catch _:_ -> {error,err_func(Mod, Func, XtraArg)} - end. + end; +invalid_unicode_error(Mod, Func, XtraArg, _S) -> + {error,err_func(Mod, Func, XtraArg)}. %% Convert error code to make it look as before err_func(io_lib, get_until, {_,F,_}) -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor