[PATCH v2 0/1] MR5088: powershell: Read input command from stdin.
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. -- v2: powershell: Read input command from stdin. https://gitlab.winehq.org/wine/wine/-/merge_requests/5088
From: Paul Gofman <pgofman(a)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..a7c0a1c811a 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 (*p && !iswspace(*p)) ++p; + if (p > command && !strnicmp(command, "exit", p - command)) + break; + } + } + } return 0; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5088
participants (2)
-
Paul Gofman -
Paul Gofman (@gofman)