cmd: Avoid unnecessary null pointer checks.

This commit is contained in:
Frédéric Delanoy 2011-10-29 01:08:49 +02:00 committed by Alexandre Julliard
parent 2e2382bfdd
commit 41a9450440
1 changed files with 6 additions and 8 deletions

View File

@ -278,14 +278,12 @@ static void WCMD_output_asis_handle (DWORD std_handle, const WCHAR *message) {
ptr++;
};
if (*ptr == '\n') ptr++;
WCMD_output_asis_len(message, (ptr) ? ptr - message : strlenW(message), handle);
if (ptr) {
numChars = 0;
if (++line_count >= max_height - 1) {
line_count = 0;
WCMD_output_asis_len(pagedMessage, strlenW(pagedMessage), handle);
WCMD_ReadFile(GetStdHandle(STD_INPUT_HANDLE), string, sizeof(string)/sizeof(WCHAR), &count);
}
WCMD_output_asis_len(message, ptr - message, handle);
numChars = 0;
if (++line_count >= max_height - 1) {
line_count = 0;
WCMD_output_asis_len(pagedMessage, strlenW(pagedMessage), handle);
WCMD_ReadFile(GetStdHandle(STD_INPUT_HANDLE), string, sizeof(string)/sizeof(WCHAR), &count);
}
} while (((message = ptr) != NULL) && (*ptr));
} else {