From 9cad39d66630998253c8aa5d1ec0f34d5582da56 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Sun, 18 Jul 2010 10:28:42 +0400 Subject: [PATCH] fixed io in runnerw(PY-1305) added runner for mac --- native/runner/runnerw/runnerw.cpp | 66 +++++++++++++++---------------- 1 file changed, 33 insertions(+), 33 deletions(-) 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);