"system" with [ ] in filename

A

A. Sinan Unur

No it's not. It's done by win32.c:create_command_line. The code in
there is sufficiently convoluted, and contains a sufficient number of
comments about things not working entirely as documented, as to make
me very unsure of its correctness in every case.

Well, thank you for pointing this out.

I have been studying win32.c since your response which is why it took me
a while to respond.

I am not sure why things are done this way. I'll need to play around
with some toy C programs to see why the list form of the system call
cannot be transformed into a straightforward call.

The comments on line 4040 on in
http://perl5.git.perl.org/perl.git/blob_plain/maint-5.10:/win32/win32.c
shed some light as does the following code fragment:

DllExport int
win32_spawnvp(int mode, const char *cmdname, const char *const *argv)
{
#ifdef USE_RTL_SPAWNVP
return spawnvp(mode, cmdname, (char * const *)argv);
#else
....

See, I would have expected the entire win32_spawnvp function to consist
of just the part above. I just do not know enough about the pecularities
of various C runtimes on Win32 ;-)
My point was that even multi-arg system still isn't *safe* under
Win32, and still doesn't guarantee cmd.exe (and/or whatever you've got
in %PERL5SHELL%) won't be invoked.

Point well taken. I now know how things actually work. I have yet to
understand why they can't work they way I think they should.

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top