Hi Mark,

Mark H Weaver <m...@netris.org> writes:

> In particular: `system*', `execl', `execlp', `execle', `environ', and
> `dynamic-args-call' use scm_i_allocate_string_pointers to convert a list
> of SCM strings into an argv-style array of C strings.  That function
> does a simple memcpy for narrow strings, and throws an exception for
> wide strings (via scm_i_string_chars).
>
> `environ' was particularly broken, in that it would use Latin-1 when
> setting the environment, and the locale encoding when reading the
> environment.  The `exec' functions would use the locale encoding to
> encode the program name, and Latin-1 for the arguments and environment.
> `system*' would use Latin-1 for everything.

Ouch, good catch!

> This patch fixes all of these inconsistencies, by modifying
> scm_i_allocate_string_pointers to use the locale encoding instead of
> Latin-1.
>
> Any objections to pushing this to stable-2.0?

Not from me, please go ahead!

It would be ideal if you could add a test case, say, for ‘system*’ and
‘environ’.  You could use the ‘with-latin1-locale’ tricks.

Thanks,
Ludo’.


Reply via email to