summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-07-02 21:23:24 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-10-11 09:05:59 -0700
commit504260f8bf56cf7011262c4ba3bf7d0db626dc25 (patch)
tree796b645d671eca83f741db1b7ec5500f1fc5e7a2
parent2ee7c6ce2989dbc4694fea4d8c5e5031b7f67ddb (diff)
downloadcygnal-504260f8bf56cf7011262c4ba3bf7d0db626dc25.tar.gz
cygnal-504260f8bf56cf7011262c4ba3bf7d0db626dc25.tar.bz2
cygnal-504260f8bf56cf7011262c4ba3bf7d0db626dc25.zip
Fix previous VT100 fix.
We must only set or clear the eat_newline flag if we output something. * winsup/cygwin/fhandler_console.cc (fhandler_console::write_normal): Move the flag setting code inside the if statement which performs output.
-rw-r--r--winsup/cygwin/fhandler_console.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 652eea09e..4e2834a76 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2885,19 +2885,19 @@ do_print:
/* Stop here if we reached the conversion limit. */
if (len >= CONVERT_LIMIT)
return found + trunc_buf.len;
+ /* If we output something and now x is at the left
+ * column, it means that we just output to the last column.
+ * In this case we can pretend we are still in the original
+ * line and swallow the next character if it is a newline,
+ * or a newline followed by a carriage return.
+ */
+ {
+ int x, y;
+ cursor_get (&x, &y);
+ con.eat_newline = (x == 0);
+ }
}
- /* If we output something and now x is at the left
- * column, it means that we just output to the last column.
- * In this case we can pretend we are still in the original
- * line and swallow the next character if it is a newline,
- * or a newline followed by a carriage return.
- */
- {
- int x, y;
- cursor_get (&x, &y);
- con.eat_newline = (x == 0);
- }
/* If there's still something in the src buffer, but it's not a truncated
multibyte sequence, then we stumbled over a control character or an
invalid multibyte sequence. Print it. */