[PATCH v3 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. -- v3: 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 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/programs/powershell/main.c b/programs/powershell/main.c index eb9a64ff0ec..25a4d13d340 100644 --- a/programs/powershell/main.c +++ b/programs/powershell/main.c @@ -24,10 +24,25 @@ 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 && !isspace(*p)) ++p; + *p = 0; + if (!stricmp(command, "exit")) + break; + } + } + } return 0; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5088
participants (2)
-
Paul Gofman -
Paul Gofman (@gofman)