mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
check for and write new lines as ascii only in copy /A, regardless of whether cmd was compiled as unicode or ansi
svn path=/trunk/; revision=18188
This commit is contained in:
parent
0f55e53480
commit
626370f6aa
1 changed files with 6 additions and 4 deletions
|
@ -240,7 +240,8 @@ int copy (TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFl
|
|||
{
|
||||
for (i = 0; i < dwRead; i++)
|
||||
{
|
||||
if (((LPTSTR)buffer)[i] == 0x1A)
|
||||
/* we're dealing with ASCII files! */
|
||||
if (((LPSTR)buffer)[i] == 0x1A)
|
||||
{
|
||||
bEof = TRUE;
|
||||
break;
|
||||
|
@ -273,12 +274,13 @@ int copy (TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFl
|
|||
|
||||
if (lpdwFlags & COPY_ASCII)
|
||||
{
|
||||
((LPTSTR)buffer)[0] = 0x1A;
|
||||
((LPTSTR)buffer)[1] = _T('\0');
|
||||
/* we're dealing with ASCII files! */
|
||||
((LPSTR)buffer)[0] = 0x1A;
|
||||
((LPSTR)buffer)[1] = '\0';
|
||||
#ifdef _DEBUG
|
||||
DebugPrintf (_T("appending ^Z\n"));
|
||||
#endif
|
||||
WriteFile (hFileDest, buffer, sizeof(TCHAR), &dwWritten, NULL);
|
||||
WriteFile (hFileDest, buffer, sizeof(CHAR), &dwWritten, NULL);
|
||||
}
|
||||
|
||||
free (buffer);
|
||||
|
|
Loading…
Reference in a new issue