mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
[NOTEPAD] Convert NULL characters to spaces when reading binary files
See issue #3573 for more details. svn path=/trunk/; revision=46873
This commit is contained in:
parent
640fb7d222
commit
76a82f0995
1 changed files with 6 additions and 2 deletions
|
@ -51,7 +51,7 @@ BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding
|
||||||
{
|
{
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
LPBYTE pBytes = NULL;
|
LPBYTE pBytes = NULL;
|
||||||
LPCWSTR pszText;
|
LPWSTR pszText;
|
||||||
LPWSTR pszAllocText = NULL;
|
LPWSTR pszAllocText = NULL;
|
||||||
DWORD dwPos, i;
|
DWORD dwPos, i;
|
||||||
DWORD dwCharCount;
|
DWORD dwCharCount;
|
||||||
|
@ -110,7 +110,7 @@ BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
case ENCODING_UNICODE:
|
case ENCODING_UNICODE:
|
||||||
pszText = (LPCWSTR) &pBytes[dwPos];
|
pszText = (LPWSTR) &pBytes[dwPos];
|
||||||
dwCharCount = (dwSize - dwPos) / sizeof(WCHAR);
|
dwCharCount = (dwSize - dwPos) / sizeof(WCHAR);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -174,6 +174,10 @@ BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding
|
||||||
else
|
else
|
||||||
adwEolnCount[EOLN_LF]++;
|
adwEolnCount[EOLN_LF]++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case '\0':
|
||||||
|
pszText[i] = ' ';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue