Manual Merge change 4e76517df10f1fb999a3a2d5546c24b73cc1f933

ID Author Date Message
4e76517df10f1fb999a3a2d5546c24b73cc1f933 Ray Hayes <rayhayes@rhbe.net>
9/20/2016 9:07:50 PM -07:00 Fixes to handle bash formatting on Windows
This commit is contained in:
Manoj Ampalam 2016-09-22 19:41:27 -07:00
parent d0ea7fc5dc
commit b28bc1fb79
2 changed files with 10 additions and 8 deletions

View File

@ -188,7 +188,7 @@ unsigned char* ParseBuffer(unsigned char* pszBuffer, unsigned char* pszBufferEnd
if (pszCurrent == pszNewCurrent) // Pointer didn't move inside Parse function if (pszCurrent == pszNewCurrent) // Pointer didn't move inside Parse function
{ {
pszNewCurrent += ConWriteString( (char *)pszCurrent, 1); pszNewCurrent += ConWriteString( (char *)pszCurrent, 1);
return pszBuffer + 1; return pszNewCurrent;
} }
if (pszNewCurrent > pszCurrent) if (pszNewCurrent > pszCurrent)
pszBuffer = pszNewCurrent; pszBuffer = pszNewCurrent;
@ -250,7 +250,7 @@ unsigned char* ParseBuffer(unsigned char* pszBuffer, unsigned char* pszBufferEnd
case 10: case 10:
pszBuffer++; pszBuffer++;
AutoWrap = 1; AutoWrap = 1;
GoToNextLine(); bAtEOLN = TRUE;
break; break;
case 12: case 12:
@ -912,7 +912,7 @@ unsigned char * ParseVT52(unsigned char * pszBuffer, unsigned char * pszBufferEn
break; break;
case 'H': // Cursor Home case 'H': // Cursor Home
ConSetCursorPosition(0, 0); ConSetCursorPosition(1, 1);
pszCurrent++; pszCurrent++;
bAtEOLN = FALSE; bAtEOLN = FALSE;
break; break;

View File

@ -227,7 +227,7 @@ void SendCharacter(HANDLE hInput, WORD attributes, char character) {
char formatted_output[2048]; char formatted_output[2048];
static USHORT pColor = 0; static WORD pattributes = 0;
USHORT Color = 0; USHORT Color = 0;
ULONG Status = 0; ULONG Status = 0;
@ -305,10 +305,12 @@ void SendCharacter(HANDLE hInput, WORD attributes, char character) {
StringCbPrintfExA(Next, SizeLeft, &Next, &SizeLeft, 0, "m", Color); StringCbPrintfExA(Next, SizeLeft, &Next, &SizeLeft, 0, "m", Color);
if (bUseAnsiEmulation && Color != pColor) if (bUseAnsiEmulation && attributes != pattributes)
WriteFile(hInput, formatted_output, (Next - formatted_output), &wr, NULL); WriteFile(hInput, formatted_output, (Next - formatted_output), &wr, NULL);
WriteFile(hInput, &character, 1, &wr, NULL); WriteFile(hInput, &character, 1, &wr, NULL);
pattributes = attributes;
} }
void SendBuffer(HANDLE hInput, CHAR_INFO *buffer, DWORD bufferSize) { void SendBuffer(HANDLE hInput, CHAR_INFO *buffer, DWORD bufferSize) {