[PATCH 1/3] programs/conhost: correctly recompute start of edit line on ReadConsole

Eric Pouech eric.pouech at gmail.com
Thu Mar 24 08:46:40 CDT 2022


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 programs/conhost/conhost.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 11e97993fd8..461adc05bcc 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -1426,8 +1426,8 @@ static NTSTATUS read_console( struct console *console, unsigned int ioctl, size_
         if (offset > ctx->home_x)
         {
             int deltay;
-            offset -= ctx->home_x;
-            deltay = offset / console->active->width;
+            offset -= ctx->home_x + 1;
+            deltay = offset / console->active->width + 1;
             if (ctx->home_y >= deltay)
                 ctx->home_y -= deltay;
             else




More information about the wine-devel mailing list