From 5d0bfc1b212381e63193a1064974b29b376e73c7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 6 Apr 2008 11:35:26 +0000 Subject: [PATCH] If the cursor-definition is missing from the menu, put cursor to the end of the last line of the banner. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@447 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- dgamelaunch.c | 4 ++++ examples/dgamelaunch.conf | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dgamelaunch.c b/dgamelaunch.c index c43e8a5..2732fb4 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -315,9 +315,13 @@ loadbanner (char *fname, struct dg_banner *ban) while (fgets (buf, 80, bannerfile) != NULL) { char bufnew[80]; + int slen; memset (bufnew, 0, 80); + slen = strlen(buf); + if ((slen > 0) && (buf[slen-1] == '\n')) buf[slen-1] = '\0'; + ban->len++; ban->lines = realloc (ban->lines, sizeof (char *) * ban->len); diff --git a/examples/dgamelaunch.conf b/examples/dgamelaunch.conf index dfc009a..dc2ca2e 100644 --- a/examples/dgamelaunch.conf +++ b/examples/dgamelaunch.conf @@ -133,7 +133,9 @@ menu["mainmenu_user"] { # the file must be inside the chroot. bannerfile = "dgl_menu_main_user.txt" # after which cursor is moved to this location - cursor = (5,18) +# if cursor-definition is missing, the cursor is put +# to the end of the last line of the banner. +# cursor = (5,18) # keys we accept. format is # commands["string_of_keys"] = # for example, you could use commands["qQ"] = quit -- 2.47.3