]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-10 Vladimir Serbinenko <phcoder@gmail.com>
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 10 Jan 2010 21:34:25 +0000 (22:34 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 10 Jan 2010 21:34:25 +0000 (22:34 +0100)
* normal/cmdline.c (grub_cmdline_get): Fix off-by-one error
which resulted in garbled command line at the end of screen.

ChangeLog
normal/cmdline.c

index 5f141d6a5d564f764629dcbf2b72b39529a8593a..65da2542de73530ad1ff51cd726049cde565846d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * normal/cmdline.c (grub_cmdline_get): Fix off-by-one error
+       which resulted in garbled command line at the end of screen.
+
 2010-01-10  Robert Millan  <rmh.grub@aybabtu.com>
 
        * loader/i386/ieee1275/linux.c (grub_linux_boot): Rework video position
index 656b14c6abe9d0270935041ddd26401fad330d09..429c84be70f5731fa607b736dd0adf1518883944 100644 (file)
@@ -254,21 +254,20 @@ grub_cmdline_get (const char *prompt)
 
       for (p = buf + pos; p < buf + llen; p++)
        {
-         if (cl_term->xpos++ > cl_term->width - 2)
+         if (c)
+           grub_putcode (c, cl_term->term);
+         else
+           grub_putcode (*p, cl_term->term);
+         cl_term->xpos++;
+         if (cl_term->xpos >= cl_term->width - 1)
            {
-             grub_putcode ('\n', cl_term->term);
-
-             cl_term->xpos = 1;
-             if (cl_term->ypos == (unsigned) (cl_term->height))
+             cl_term->xpos = 0;
+             if (cl_term->ypos >= (unsigned) (cl_term->height - 1))
                cl_term->ystart--;
              else
                cl_term->ypos++;
+             grub_putcode ('\n', cl_term->term);
            }
-
-         if (c)
-           grub_putcode (c, cl_term->term);
-         else
-           grub_putcode (*p, cl_term->term);
        }
     }