mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 09:20:30 +00:00
patch from : Paolo Devoti <devotip at gmail.com>
fix issue : The fix does a WriteFile per line insted of one per char. See issue #2015 for more details. svn path=/trunk/; revision=25703
This commit is contained in:
parent
d8540d8289
commit
0b971d5007
1 changed files with 38 additions and 48 deletions
|
@ -12,6 +12,9 @@
|
|||
*
|
||||
* 01-Jul-2005 (Brandon Turner) <turnerb7@msu.edu>)
|
||||
* Added ConPrintfPaging and ConOutPrintfPaging
|
||||
*
|
||||
* 02-Feb-2007 (Paolo Devoti) <devotip at gmail.com>)
|
||||
* Fixed ConPrintfPaging
|
||||
*/
|
||||
|
||||
|
||||
|
@ -252,8 +255,8 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa
|
|||
/* the number of chars in a roow */
|
||||
int ScreenCol = 0;
|
||||
|
||||
/* chars since end of line */
|
||||
int CharEL = 0;
|
||||
/* chars since start of line */
|
||||
int CharSL = 0;
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
@ -288,27 +291,14 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa
|
|||
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
// search 'end of string' '\n' or 'end of screen line'
|
||||
for(; (i < len) && (pBuf[i] != _T('\n') && (CharSL<ScreenCol)) ; i++)
|
||||
CharSL++;
|
||||
|
||||
if(pBuf[i] == _T('\n'))
|
||||
{
|
||||
WriteFile (GetStdHandle (nStdHandle),&pBuf[i-CharSL],sizeof(CHAR)*(CharSL+1),&dwWritten,NULL);
|
||||
LineCount++;
|
||||
CharEL=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
CharEL++;
|
||||
if (CharEL>=ScreenCol)
|
||||
{
|
||||
if (i+1<len)
|
||||
{
|
||||
if(pBuf[i+1] != _T('\n')) LineCount++;
|
||||
}
|
||||
CharEL=0;
|
||||
}
|
||||
}
|
||||
CharSL=0;
|
||||
|
||||
/* FIXME : write more that one char at time */
|
||||
WriteFile (GetStdHandle (nStdHandle),&pBuf[i],sizeof(CHAR),&dwWritten,NULL);
|
||||
if(LineCount >= ScreenLines)
|
||||
{
|
||||
if(_tcsnicmp(&pBuf[i], _T("\n"), 2)!=0)
|
||||
|
@ -320,7 +310,7 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa
|
|||
}
|
||||
//reset the number of lines being printed
|
||||
LineCount = 0;
|
||||
CharEL=0;
|
||||
CharSL=0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue