From f45e1a9fb790237b066d2f1e706e896fcc5a9e15 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 27 Dec 2009 22:34:49 +0100 Subject: [PATCH 1/3] Allocate correct size --- normal/term.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/normal/term.c b/normal/term.c index b099ae84c..667d27ee9 100644 --- a/normal/term.c +++ b/normal/term.c @@ -167,7 +167,7 @@ read_terminal_list (void) return; } - filename = grub_malloc (grub_strlen (prefix) + sizeof ("/crypto.lst")); + filename = grub_malloc (grub_strlen (prefix) + sizeof ("/terminal.lst")); if (!filename) { grub_errno = GRUB_ERR_NONE; From dc71441293ffa0682ee2fc1f759c34bb772bb8d2 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 27 Dec 2009 22:35:40 +0100 Subject: [PATCH 2/3] Output \n\r like it was done previously because ncurses is confused by \r\n --- kern/term.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kern/term.c b/kern/term.c index 3d8777133..50fbbf302 100644 --- a/kern/term.c +++ b/kern/term.c @@ -45,9 +45,9 @@ grub_putcode (grub_uint32_t code, struct grub_term_output *term) return; } + (term->putchar) (code); if (code == '\n') (term->putchar) ('\r'); - (term->putchar) (code); } /* Put a character. C is one byte of a UTF-8 stream. From 13d1f24696a905e83c4edd7c96fafbc2081554dc Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 27 Dec 2009 22:36:09 +0100 Subject: [PATCH 3/3] Fix grub-emu compilation --- conf/any-emu.rmk | 1 + util/console.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/conf/any-emu.rmk b/conf/any-emu.rmk index bbc564c80..85ff972ab 100644 --- a/conf/any-emu.rmk +++ b/conf/any-emu.rmk @@ -28,6 +28,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c normal/crypto.c normal/term.c \ + commands/terminal.c lib/charset.c \ script/main.c script/execute.c script/function.c \ script/lexer.c script/script.c grub_script.tab.c \ partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ diff --git a/util/console.c b/util/console.c index 40ee3a638..73195765e 100644 --- a/util/console.c +++ b/util/console.c @@ -19,14 +19,6 @@ #include -#if defined(HAVE_NCURSES_CURSES_H) -# include -#elif defined(HAVE_NCURSES_H) -# include -#elif defined(HAVE_CURSES_H) -# include -#endif - /* For compatibility. */ #ifndef A_NORMAL # define A_NORMAL 0 @@ -39,6 +31,14 @@ #include #include +#if defined(HAVE_NCURSES_CURSES_H) +# include +#elif defined(HAVE_NCURSES_H) +# include +#elif defined(HAVE_CURSES_H) +# include +#endif + static int grub_console_attr = A_NORMAL; grub_uint8_t grub_console_cur_color = 7;