Hi Peter,

On Thu, 6 Feb 2014 10:04:08 +0100 Peter Bex <peter....@xs4all.nl> wrote:

> On Thu, Feb 06, 2014 at 02:21:07AM +0000, Mario Domenech Goulart wrote:
>> On Wed, 05 Feb 2014 23:56:11 +0000 Mario Domenech Goulart 
>> <mario.goul...@gmail.com> wrote:
>> > The environment variable tests in posix-tests.scm caught the issue.
>> > Here's an example:
>> >
>> >   #;1> (use posix)
>> >   ; loading c:/local/chicken-master-mingw/lib/chicken/7/posix.import.so
>> >   ; ...
>> >   ; loading library posix ...
>> >   #;2> (setenv "FOO" "bar")
>> >   #;3> (get-environment-variable "FOO")
>> >   "x\x01=b\x03"
>> >
>> > Reverting 8efbbc50d050d28c34ea0c5a58d0de92ec9f918a makes tests pass
>> > again.  Tested on cygwin, mingw (Windows XP 32bit).
>> 
>> I forgot to mention that on cygwin I had to define HAVE_STRLCAT and
>> HAVE_STRLCPY in Makefile.cygwin, otherwise I'd get errors like
>> http://paste.call-cc.org/paste?id=87b50bb84351693193183e7c58f2293b6cd52148
>> 
>> After defining HAVE_STRLCAT and STRLCPY and rebuilding chicken, I get
>> the environment variables issue.
>
> I've added that.  Here's a patch that should fix the setenv issue.
> I haven't tested it yet, so please give it a try.
>
> The second patch should prevent these collision problems if for some
> reason a library happens to define strlcat() even if HAVE_STRLCAT is
> not defined.  This can not only happen if HAVE_STRLCAT is erroneously
> omitted on platforms that simply have it, but also on Linux for example,
> when using libbsd and including bsd/string.h

I quickly tested your patches.

0001-Prevent-problems-when-the-host... breaks Linux and mingw-msys
("undefined reference to strlcat").  Doesn't seem to cause problems on
cygwin.

0002-Fix-strlcat-usage-in-setenv... doesn't fix the setenv issue (tested
on Windows XP, cygwin).

Best wishes.
Mario
-- 
http://parenteses.org/mario

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to