diff --git a/native/runner/runnerw/runnerw.cpp b/native/runner/runnerw/runnerw.cpp index 99e46b1a681c..01fc6b154dbf 100644 --- a/native/runner/runnerw/runnerw.cpp +++ b/native/runner/runnerw/runnerw.cpp @@ -8,9 +8,12 @@ void PrintUsage() { printf("Usage: runnerw.exe \n"); printf("where is console application and it's arguments.\n"); printf("\n"); - printf("Runner invokes console application as a process with inherited input and output streams.\n"); - printf("Input stream is scanned for presence of 2 char 255(IAC) and 243(BRK) sequence and generates Ctrl-Break event in that case.\n"); - printf("Also in case of all type of event(Ctrl-C, Close, Shutdown etc) Ctrl-Break event is generated.\n"); + printf( + "Runner invokes console application as a process with inherited input and output streams.\n"); + printf( + "Input stream is scanned for presence of 2 char 255(IAC) and 243(BRK) sequence and generates Ctrl-Break event in that case.\n"); + printf( + "Also in case of all type of event(Ctrl-C, Close, Shutdown etc) Ctrl-Break event is generated.\n"); exit(0); } @@ -35,11 +38,11 @@ void CtrlBreak() { BOOL is_iac = FALSE; -char IAC = 'a'; -char BRK = 'b'; +char IAC = 255; +char BRK = 243; BOOL Scan(char buf[], int count) { - for (int i = 0; i> c; -// char c = fgetc(); - buf[0] = c; - Scan(buf, 1); - WriteFile(write_stdin, buf, 1, &b_write, NULL); + char c; + std::cin >> c; + buf[0] = c; + Scan(buf, 1); + WriteFile(write_stdin, buf, 1, &b_write, NULL); } CloseHandle(pi.hThread);