[tex-live] possible tlmgr bug
st_philipp at yahoo.de
Wed May 4 17:29:26 CEST 2011
Am 04.05.2011 um 15:55 schrieb Adam R. Maxwell:
> On May 4, 2011, at 00:05 , Reinhard Kotucha wrote:
>> Sorry, but I fear that there are some other scripts in TeX Live which
>> can't deal with spaces in filenames. They can't be fixed easily and
>> it would make more sense to re-write them in Perl in order to make
>> them work on Windows too.
> So this line in TLUtils.pm will handle spaces correctly? It's
> approximately near the one Artemio called out:
> chomp (my $guessed_platform = `/bin/sh $config_guess`);
> Are backticks in Perl handled differently from Bourne shell?
AFAIK it is passed directly to the shell which does word splitting. For myself I tend to avoid calling the shell whenever possible when I try to write OS-independent code. The popular "system" function in C is probably the biggest source of problems; it should be replaced by direct process creation (CreateProcessW on Windows, posix_spawn/execve on Linux, or wrappers thereof).
In this case, the /bin/sh seems to indicate that you can be sure in that branch of the code that /bin/sh is a valid file name and points to a Bourne-compatible shell. Then even something like `/bin/sh '$config_guess'` might work (unless the path $config_guess contains an ASCII apostrophe, of course).
More information about the tex-live