]> skyeroc.xyz Git - dgamelaunch/commitdiff
If the cursor-definition is missing from the menu, put cursor to the end of the last...
authorPasi Kallinen <paxed@alt.org>
Sun, 6 Apr 2008 11:35:26 +0000 (11:35 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 6 Apr 2008 11:35:26 +0000 (11:35 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@447 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c
examples/dgamelaunch.conf

index c43e8a5540dc55d65b3bffedf1a9a2275c7c1f15..2732fb49ac10fafcb9f777e7551b0d62d0221d53 100644 (file)
@@ -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);
 
index dfc009a42e4a0d812178898b6f40be36cf77a824..dc2ca2ee98f65390a2721623b08cd7ada85f7963 100644 (file)
@@ -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"] = <commandlist>
 # for example, you could use commands["qQ"] = quit