Besides logging that command, this patch fixes Hero's Land which execures various query commands with powershell. It can survive empty output but aborts if writing command to piped powershell stdin fails.
From: Paul Gofman pgofman@codeweavers.com
--- programs/powershell/main.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/programs/powershell/main.c b/programs/powershell/main.c index eb9a64ff0ec..e3214c26859 100644 --- a/programs/powershell/main.c +++ b/programs/powershell/main.c @@ -24,10 +24,24 @@ int __cdecl wmain(int argc, WCHAR *argv[]) { int i;
- WINE_FIXME("stub:"); + WINE_FIXME("stub.\n"); for (i = 0; i < argc; i++) - WINE_FIXME(" %s", wine_dbgstr_w(argv[i])); - WINE_FIXME("\n"); + { + WINE_FIXME("argv[%d] %s\n", i, wine_dbgstr_w(argv[i])); + if (!wcsicmp(argv[i], L"-command") && i < argc - 1 && !wcscmp(argv[i + 1], L"-")) + { + char command[4096], *p;
+ ++i; + while (fgets(command, sizeof(command), stdin)) + { + WINE_FIXME("command %s.\n", debugstr_a(command)); + p = command; + while (!iswspace(*p)) ++p; + if (!strnicmp(command, "exit", p - command)) + break; + } + } + } return 0; }