* grub-core/normal/menu_entry.c (kill_line): Fix a crash and off-by-one

error.
This commit is contained in:
Hideki EIRAKU 2012-03-05 00:02:17 +01:00 committed by Vladimir 'phcoder' Serbinenko
parent 93b1cd79c8
commit cb05528616
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2012-03-04 Hideki EIRAKU <hdk1983@gmail.com>
* grub-core/normal/menu_entry.c (kill_line): Fix a crash and off-by-one
error.
2012-03-04 Vladimir Serbinenko <phcoder@gmail.com> 2012-03-04 Vladimir Serbinenko <phcoder@gmail.com>
Use sort -V by the idea of Georgi Georgiev. Use sort -V by the idea of Georgi Georgiev.

View file

@ -890,7 +890,7 @@ kill_line (struct screen *screen, int continuous, int update)
return 0; return 0;
grub_memmove (p + offset, linep->buf + screen->column, size); grub_memmove (p + offset, linep->buf + screen->column, size);
p[offset + size - 1] = '\0'; p[offset + size] = '\0';
screen->killed_text = p; screen->killed_text = p;
@ -900,9 +900,9 @@ kill_line (struct screen *screen, int continuous, int update)
if (update) if (update)
{ {
new_num = get_logical_num_lines (linep, &screen->terms[i]);
for (i = 0; i < screen->nterms; i++) for (i = 0; i < screen->nterms; i++)
{ {
new_num = get_logical_num_lines (linep, &screen->terms[i]);
if (orig_num[i] != new_num) if (orig_num[i] != new_num)
update_screen (screen, &screen->terms[i], update_screen (screen, &screen->terms[i],
screen->line, screen->column, 0, 1, ALL_LINES); screen->line, screen->column, 0, 1, ALL_LINES);