mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[CONSRV]
Fix copy of text in text-mode screenbuffers, in case we are copying NULL chars. svn path=/trunk/; revision=59434
This commit is contained in:
parent
72badc4dd2
commit
c3eb80aa84
1 changed files with 9 additions and 1 deletions
|
@ -83,7 +83,15 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer)
|
|||
/* Copy only the characters, leave attributes alone */
|
||||
for (xPos = 0; xPos < selWidth; xPos++)
|
||||
{
|
||||
dstPos[xPos] = ptr[xPos].Char.UnicodeChar;
|
||||
/*
|
||||
* Sometimes, applications can put NULL chars into the screen-buffer
|
||||
* (this behaviour is allowed). Detect this and replace by a space.
|
||||
* FIXME - HACK: Improve the way we're doing that (i.e., put spaces
|
||||
* instead of NULLs (or even, nothing) only if it exists a non-null
|
||||
* char *after* those NULLs, before the end-of-line of the selection.
|
||||
* Do the same concerning spaces -- i.e. trailing spaces --).
|
||||
*/
|
||||
dstPos[xPos] = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' ');
|
||||
}
|
||||
dstPos += selWidth;
|
||||
|
||||
|
|
Loading…
Reference in a new issue