[Ecls-list] Recent bug with getenv

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Wed Feb 9 08:55:00 UTC 2011


2011/2/9 Didier Verna <didier at lrde.epita.fr>

>
> > Nothing has changed in ECL, it is just that Unicode builds are now the
> > default and it triggered this unexpected condition. I just changed
> > GETENV to coerce its input to the appropriate type.
>
>   But shouldn't I be the one to do that in my own application instead? I
> mean, I *know* that my strings really are base strings, but ECL doesn't.
>

Ok, here I go again :-) Several POSIX routines in ECL do a   string ->
base-string checked coercion that does the following steps:

1) It verifies that the original string only contains base-char. If this is
not the case, it signals an error.
2) It duplicates the string, creating a base-string which has as length the
length of the original one (taking into account the fill pointer), contains
the same characters and is zero terminated.

So, again, the routine will signal an error if the input is not compatible
with a POSIX call, but if it is, it will do its best to accomodate it into a
(char *)

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20110209/7f3cb97e/attachment.html>


More information about the ecl-devel mailing list