extrac32: Preprocess command line before passing to CommandLineToArgvW().
serhio at etersoft.ru
Thu Apr 4 07:19:22 CDT 2013
Playing with one application, that uses extrac32.exe,
I've found that Wine's extrac32 can't process some
command lines, that cause no problem with native one.
For example builtin extrac32 can't eat command line
extrac32 ... "path\to\dir\" "another\path"
Native extrac32 interprets each quoted string above
as separate argument, i.e. arg n - 'path\to\dir\',
arg n + 1 - 'another\path', but builtin does next -
arg n - 'path\to\dir" another\path'
This problem caused by CommandLineToArgvW(), that used
at builtin extrac32 for command line parsing. This API
uses special rules for processing quotes when they
are preceded by backslashes. This behavior leads to
problem described in example above (due \" sequence
There are two ways to solve this promlem:
- write own parser for extrac32,
- perform some translation for command line before
passing to CommandLineToArgvW().
I think that second variant is more appropriate.
Proposed solution translates original command line
to new by using next substitution:
n backslashes + " ==> 2n backslashes + "
This is symmetrical to CommandLineToArgvW's rule,
that causes described problem, and neutralizes it.
And after parsing we get arguments, that are
applicable for next actions.
programs/extrac32/extrac32.c | 73
1 files changed, 72 insertions(+), 1 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3311 bytes
Desc: not available
More information about the wine-patches