make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for missing shell commands in rc2


From: Eli Zaretskii
Subject: Re: Patch for missing shell commands in rc2
Date: Wed, 22 Mar 2006 06:40:08 +0200

> From: "J. David Bryan" <address@hidden>
> Date: Tue, 21 Mar 2006 17:35:45 -0500
> CC: address@hidden
> 
> On 21 Mar 2006 at 22:21, Eli Zaretskii wrote:
> 
> > ...the way commands are invoked via the shell is very different from
> > how programs are invoked directly.... 
> 
> I understand (correctly, I hope) that CreateProcess is passed a temporary 
> batch filename for shell commands and the name of the executable for direct 
> invocation.

Yes, but the code that processes the command before that is different.

> > One notable problem is the forward vs backslashes in file names: when
> > you invoke "c:/foo/bar/baz.exe" from the shell, you must first convert
> > the forward slashes to backslashes.
> 
> Granted.  But the added shell commands wouldn't contain slashes in their 
> invocations, so I don't understand your example.

My example is with the following command:

   start c:/foo/bar/baz.exe

Do you see the issue now?

> I'm trying to think of a case where that would be a problem as a result of 
> adding new commands to the sh_cmds_dos set.  Are you thinking that someone 
> using command.com might have a makefile that invokes a command with the 
> same name as a cmd.exe internal command, is currently passing forward-
> slashed filenames to it, which it accepts, whereas if the same parameters 
> were passed via a batch file invocation, it wouldn't?

Yes, see above.

> > OTOH, it should be very easy to do this at run time rather than at
> > compile time, if $SHELL is cmd.exe.  Why risk problematic changes when
> > the Right Thing is so easily done?
> 
> Hmmm...how easily done is it?  Would you set sh_cmds differently for 
> command.com and cmd.exe each time through construct_command_argv_internal?  

Yes.

> Would you obtain and parse COMSPEC each time through?

Each time would be fine, although some caching might also be coded.

> Parse and save COMSPEC once on startup and SHELL each time through?

Yes, something like that.  But on startup is not good enough, since
the Makefile can set SHELL.

> I'll give it a try, with some guidance here.

Thanks.  Feel free to ask for advice.

> As it is now, I can't use a makefile containing the command "start
> <something>" on NT and 9x without hand waving.

I cannot imagine you really need to invoke a command via "start" in a
Makefile.  If that's a real example, can you describe it in mode
detail?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]