Commit 91cce00d authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

cmd: Better handle ctrl-c events.

cmd shouldn't terminate itself when user hits ctrl-c. cmd should terminate the currently running CUI child it waits for upon ctrl-c. Signed-off-by: 's avatarEric Pouech <epouech@codeweavers.com>
parent b228e3df
......@@ -2411,6 +2411,12 @@ void WCMD_free_commands(CMD_LIST *cmds) {
}
}
static BOOL WINAPI my_event_handler(DWORD ctrl)
{
WCMD_output(L"\n");
return ctrl == CTRL_C_EVENT;
}
/*****************************************************************************
* Main entry point. This is a console application so we have a main() not a
......@@ -2658,6 +2664,10 @@ int __cdecl wmain (int argc, WCHAR *argvW[])
if (opt_s && *cmd=='\"')
WCMD_strip_quotes(cmd);
}
else
{
SetConsoleCtrlHandler(my_event_handler, TRUE);
}
/* Save cwd into appropriate env var (Must be before the /c processing */
GetCurrentDirectoryW(ARRAY_SIZE(string), string);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment