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
{
pszNewCurrent += ConWriteString( (char *)pszCurrent, 1);
return pszBuffer + 1;
return pszNewCurrent;
}
if (pszNewCurrent > pszCurrent)
pszBuffer = pszNewCurrent;
@ -250,8 +250,8 @@ unsigned char* ParseBuffer(unsigned char* pszBuffer, unsigned char* pszBufferEnd
case 10:
pszBuffer++;
AutoWrap = 1;
GoToNextLine();
break;
bAtEOLN = TRUE;
break;
case 12:
pszBuffer++;
@ -869,7 +869,7 @@ unsigned char * ParseANSI(unsigned char * pszBuffer, unsigned char * pszBufferEn
bCS1 = 0;
bBkMode = 0;
bCharMode = 0;
return pszCurrent;
return pszCurrent;
}
else
return pszBuffer;
@ -912,9 +912,9 @@ unsigned char * ParseVT52(unsigned char * pszBuffer, unsigned char * pszBufferEn
break;
case 'H': // Cursor Home
ConSetCursorPosition(0, 0);
ConSetCursorPosition(1, 1);
pszCurrent++;
bAtEOLN = FALSE;
bAtEOLN = FALSE;
break;
case 'I': // Reverse Line Feed
pszCurrent++;

View File

@ -227,7 +227,7 @@ void SendCharacter(HANDLE hInput, WORD attributes, char character) {
char formatted_output[2048];
static USHORT pColor = 0;
static WORD pattributes = 0;
USHORT Color = 0;
ULONG Status = 0;
@ -305,10 +305,12 @@ void SendCharacter(HANDLE hInput, WORD attributes, char character) {
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, &character, 1, &wr, NULL);
pattributes = attributes;
}
void SendBuffer(HANDLE hInput, CHAR_INFO *buffer, DWORD bufferSize) {