[CONUTILS][CMD] Add and use a helper ConStdStreamsSetCacheCodePage() macro instead of repeatedly calling ConStreamSetCacheCodePage() on the standard streams.

This commit is contained in:
Hermès Bélusca-Maïto 2021-05-26 00:01:26 +02:00
parent f268430c05
commit 35f499e52f
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 16 additions and 7 deletions

View file

@ -529,9 +529,7 @@ Execute(LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
OutputCodePage = uNewOutputCodePage;
/* Update the streams codepage cache as well */
ConStreamSetCacheCodePage(StdIn , InputCodePage );
ConStreamSetCacheCodePage(StdOut, OutputCodePage);
ConStreamSetCacheCodePage(StdErr, OutputCodePage);
ConStdStreamsSetCacheCodePage(InputCodePage, OutputCodePage);
}
/* Restore the original console title */

View file

@ -321,9 +321,7 @@ INT cmd_start (LPTSTR Rest)
OutputCodePage = uNewOutputCodePage;
/* Update the streams codepage cache as well */
ConStreamSetCacheCodePage(StdIn , InputCodePage );
ConStreamSetCacheCodePage(StdOut, OutputCodePage);
ConStreamSetCacheCodePage(StdErr, OutputCodePage);
ConStdStreamsSetCacheCodePage(InputCodePage, OutputCodePage);
}
}
else