Skip to content

Commit

Permalink
powershell: Read input command from stdin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Gofman authored and julliard committed Feb 16, 2024
1 parent 75fa35a commit 1a4163b
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions programs/powershell/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 1a4163b

Please sign in to comment.