readconfig: Don't display "(null)" labels when hitting TAB
authorMatt Fleming <matt.fleming@intel.com>
Thu, 28 Feb 2013 15:07:19 +0000 (15:07 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Thu, 7 Mar 2013 12:17:55 +0000 (12:17 +0000)
It is entirely legitimate for a menu entry to have a NULL label or
displayname. Since these entries are not used for execution, skip
displaying them in print_labels() when hitting the TAB key.

Reported-by: Bernd Blaauw <bblaauw@home.nl>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/elflink/ldlinux/readconfig.c

index 036a1df..9d50c2f 100644 (file)
@@ -473,6 +473,9 @@ void print_labels(const char *prefix, size_t len)
 
     printf("\n");
     for (me = all_entries; me; me = me->next ) {
+       if (!me->label)
+           continue;
+
        if (!strncmp(prefix, me->label, len))
            printf(" %s", me->label);
     }