- /* Set the attribute for these characters. */
- if (!FillConsoleOutputAttribute (cur_screen, char_attr,
- produced, cursor_coords, &r))
- {
- printf ("Failed writing console attributes: %d\n",
- GetLastError ());
- fflush (stdout);
- }
-
- /* Write the characters. */
- if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer,
- produced, cursor_coords, &r))
- {
- printf ("Failed writing console characters: %d\n",
- GetLastError ());
- fflush (stdout);
- }
-
- cursor_coords.X += produced;
- move_cursor (cursor_coords.Y, cursor_coords.X);
- }
- len -= consumed;
- n -= consumed;
- string += consumed;
- }
- }
-
- /* We may have to output some codes to terminate the writing. */
- if (CODING_REQUIRE_FLUSHING (&terminal_coding))
- {
- terminal_coding.mode |= CODING_MODE_LAST_BLOCK;
- encode_coding (&terminal_coding, "", conversion_buffer,
- 0, conversion_buffer_size);
- if (terminal_coding.produced > 0)
- {
- if (!FillConsoleOutputAttribute (cur_screen, char_attr_normal,
- terminal_coding.produced,
- cursor_coords, &r))
- {
- printf ("Failed writing console attributes: %d\n",
- GetLastError ());
- fflush (stdout);
- }
-
- /* Write the characters. */
- if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer,
- produced, cursor_coords, &r))
- {
- printf ("Failed writing console characters: %d\n",
- GetLastError ());
- fflush (stdout);
- }
- }
+ printf ("Failed writing console attributes: %d\n",
+ GetLastError ());
+ fflush (stdout);
+ }
+
+ /* Write the characters. */
+ if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer,
+ coding->produced, cursor_coords,
+ &r))
+ {
+ printf ("Failed writing console characters: %d\n",
+ GetLastError ());
+ fflush (stdout);
+ }
+
+ cursor_coords.X += coding->produced;
+ w32con_move_cursor (cursor_coords.Y, cursor_coords.X);
+ }
+ len -= n;
+ string += n;