]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/normal/cmdline.c (grub_cmdline_get): Fix off-by-one error
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 14 May 2013 06:54:18 +0000 (08:54 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 14 May 2013 06:54:18 +0000 (08:54 +0200)
to avoid losing last column.

ChangeLog
grub-core/normal/cmdline.c

index 0b0fa4ae6cf79113da143ad4c504dbc144373c21..00c23e2290993927b04720943a85a4a136f5aaf3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/normal/cmdline.c (grub_cmdline_get): Fix off-by-one error
+       to avoid losing last column.
+
 2013-05-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * po/exclude.pot: Add missing string "%C".
index a9627ca7663a3d1a125103ec5d0461c20af84468..71d9bd1fcefa41a2509d39250914ea5191adb703 100644 (file)
@@ -237,9 +237,9 @@ grub_cmdline_get (const char *prompt_translated)
 
   void cl_set_pos (struct cmdline_term *cl_term)
   {
-    cl_term->xpos = (cl_term->prompt_len + lpos) % (cl_term->width - 1);
+    cl_term->xpos = (cl_term->prompt_len + lpos) % cl_term->width;
     cl_term->ypos = cl_term->ystart
-      + (cl_term->prompt_len + lpos) / (cl_term->width - 1);
+      + (cl_term->prompt_len + lpos) / cl_term->width;
     grub_term_gotoxy (cl_term->term, cl_term->xpos, cl_term->ypos);
   }