Skip to content

Commit

Permalink
FIX: ANSI escape sequence handling was not working if compiled with W…
Browse files Browse the repository at this point in the history
…indows subsystem
  • Loading branch information
Oldes committed Oct 18, 2017
1 parent 2c22bdd commit 973d394
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/os/win32/dev-stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ static void close_stdio(void)
ok = WriteFile(Std_Out, bp, ep - bp, &total, 0);
bp = ep;
}
if (!ok) {
req->error = GetLastError();
return DR_ERROR;
}
} else { // for Windows SubSystem - must be converted to Win32 wide-char format

// Thankfully, MS provides something other than mbstowcs();
Expand All @@ -317,12 +321,6 @@ static void close_stdio(void)
bp = Parse_ANSI_sequence(++cp, ep);
}
}

if (!ok) {
req->error = GetLastError();
return DR_ERROR;
}

} while (bp < ep);

req->actual = req->length; // do not use "total" (can be byte or wide)
Expand Down

0 comments on commit 973d394

Please sign in to comment.