From: Vladimir 'phcoder' Serbinenko Date: Tue, 14 May 2013 06:54:18 +0000 (+0200) Subject: * grub-core/normal/cmdline.c (grub_cmdline_get): Fix off-by-one error X-Git-Tag: grub-2.02-beta1~997 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8d6cc3cf0fa120e2112317cb4bc5d083946c2c2;p=thirdparty%2Fgrub.git * grub-core/normal/cmdline.c (grub_cmdline_get): Fix off-by-one error to avoid losing last column. --- diff --git a/ChangeLog b/ChangeLog index 0b0fa4ae6..00c23e229 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-05-14 Vladimir Serbinenko + + * grub-core/normal/cmdline.c (grub_cmdline_get): Fix off-by-one error + to avoid losing last column. + 2013-05-14 Vladimir Serbinenko * po/exclude.pot: Add missing string "%C". diff --git a/grub-core/normal/cmdline.c b/grub-core/normal/cmdline.c index a9627ca76..71d9bd1fc 100644 --- a/grub-core/normal/cmdline.c +++ b/grub-core/normal/cmdline.c @@ -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); }