Some bugfixes in ei_x_format in R13B02-1

christopher faulet <>
Fri Oct 9 16:38:56 CEST 2009


Hi all,

the attached patch fixes some bugs in functions that build terms from
strings, called by ei_x_format and ei_x_format_wo_ver. It improves the
parsing of lists, tuples, strings, atoms and digits. The file test_ei.c
in attachement shows examples that ei_x_format doesn't parse correctly.

In addition, I added support of hexadecimal representations of digit.

This patch also fixes a bug in erl_call. When we use the option "-a 'Mod
Fun Args'", the module and function are extracted and the remainings are
passed to ei_x_format_wo_ver in order to build arguments before calling
the function ei_rpc. The problem is that this function tries to replace
all ~a,~s,~i... But in this context, it's a mistake. To avoid this
behaviour, I added a new function, ei_x_parse, that transforms a string
in erlang term without any replacement. Here is an example:

  * the following command returns an error instead of ["test"]:
      erl_call -sname bug_ei -s -a 'io_lib format ["~p", [test]]'

I only tested this patch on linux but I hope that it works on other OS.

Best regards,
-- 
Christopher Faulet <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erl_interface-R13B02-1.patch
Type: text/x-patch
Size: 13830 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20091009/10978c09/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_ei.c
Type: text/x-csrc
Size: 6305 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20091009/10978c09/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20091009/10978c09/attachment-0002.bin>


More information about the erlang-patches mailing list