1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

notepad: When opening a file, replace \0 characters with spaces, instead of truncating the file at the first \0.

This commit is contained in:
Alexander Scott-Johns 2009-07-03 01:04:00 +01:00 committed by Alexandre Julliard
parent 93b99e0af3
commit 32c066f12a

View File

@ -346,6 +346,7 @@ void DoOpenFile(LPCWSTR szFileName, ENCODING enc)
DWORD dwNumRead;
int lenW;
WCHAR* textW;
int i;
WCHAR log[5];
/* Close any files and prompt to save changes */
@ -433,6 +434,12 @@ void DoOpenFile(LPCWSTR szFileName, ENCODING enc)
}
}
/* Replace '\0's with spaces. Other than creating a custom control that
* can deal with '\0' characters, it's the best that can be done.
*/
for (i = 0; i < lenW; i++)
if (textW[i] == '\0')
textW[i] = ' ';
textW[lenW] = '\0';
if (lenW >= 1 && textW[0] == 0xfeff)