[Ohrrpgce] Windows Shell substitute

Mike caron.mike at gmail.com
Mon Oct 25 10:18:32 PDT 2010


I'm not at home at the moment, so I can't review the existing code. However, I should point out that command line parsing is the responsibility of the app. In practice, this is handled by the C/++ runtime being linked against.

I can't speak for mingw's library, but in my experience, VC++ parses command lines like such:

1. Command line arguments are separated by spaces
2. If an argument contains a space, it must be surrounded by quotes (you can't escape the space)
3. Since quotes are illegal in paths, there's no reason not to quote all paths unconditionally.

Cmd.exe, the command line processor, uses the caret (^) as an escape character (NOT backslash), but I do not think the VC++ runtime recognizes it.

My reccomendation (and, what I will do when I get home later) is to write a program that just lists its arguments and exits. If that shows as correct, but the other utilities still have problems, then its a bug in their end (unlikely as it is).

Anyway, digression asside, the win32 equivalent to SHELL is... Shell. Or, preferredly, ShellEx. I can't imagine why SHELL wouldn't be a wrapper around it.

If we opt to use it directly, it shouldn't be that big a change.
--
Mike Caron


More information about the Ohrrpgce mailing list