[Ecls-list] Recent bug with getenv

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Tue Feb 8 22:12:40 UTC 2011


On Tue, Feb 8, 2011 at 4:35 PM, Didier Verna <didier at lrde.epita.fr> wrote:

>
>  Hello,
>
> after a git upgrade today, I think there's a bug related to getenv in
> standalone executables. To reproduce, put this in test.lisp:


It depends on whether you call it a bug or a feature. Most POSIX functions
only accept base-strings. READ-LINE may return an ordinary Unicode string,
which is not compatible with the POSIX calls.

> (read-line)
PATH

"PATH"
NIL
> (type-of *)

(SIMPLE-ARRAY CHARACTER (4))
> (ext:getenv **)

Condition of type: SIMPLE-TYPE-ERROR
In function GETENV, the value of argument is
        "PATH"
which is not of expected type BASE-STRING

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.

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/20110208/83ff9ff0/attachment.html>


More information about the ecl-devel mailing list