From 5984a5105fff9910b1da45f1bee35c297e67d47d Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Tue, 4 Dec 2012 12:02:39 +0000 Subject: [PATCH] ldlinux: Use get_msg_file() for F-keys The file that we display with the F-keys may contain background or foreground color codes and so needs to be interpreted by get_msg_file() instead of just printing the color codes as ascii to the screen with cat_file(). Signed-off-by: Matt Fleming --- com32/elflink/ldlinux/readconfig.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c index cc57dd8..64c20a0 100644 --- a/com32/elflink/ldlinux/readconfig.c +++ b/com32/elflink/ldlinux/readconfig.c @@ -636,21 +636,7 @@ static char *is_message_name(char *cmdstr, enum message_number *msgnr) return NULL; } -static int cat_file(const char *filename) -{ - FILE *f; - char line[2048]; - - f = fopen(filename, "r"); - if (!f) - return -1; - - while (fgets(line, sizeof(line), f) != NULL) - eprintf("%s", line); - - fclose(f); - return 0; -} +extern void get_msg_file(char *); void cat_help_file(int key) { @@ -704,7 +690,7 @@ void cat_help_file(int key) if (cm->fkeyhelp[fkey].textname) { eprintf("\n"); - cat_file(cm->fkeyhelp[fkey].textname); + get_msg_file((char *)cm->fkeyhelp[fkey].textname); } } @@ -748,7 +734,6 @@ static inline void io_delay(void) outb(0, 0x80); } -extern void get_msg_file(char *); extern void loadfont(char *); extern void loadkeys(char *); -- 2.7.4