Magellan Linux

Diff of /trunk/grubby/grubby.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2976 by niro, Thu Jun 30 10:17:00 2016 UTC revision 2977 by niro, Thu Jun 30 10:24:27 2016 UTC
# Line 829  static int isEntryStart(struct singleLin Line 829  static int isEntryStart(struct singleLin
829    
830  /* extract the title from within brackets (for zipl) */  /* extract the title from within brackets (for zipl) */
831  static char * extractTitle(struct singleLine * line) {  static char * extractTitle(struct singleLine * line) {
832      /* bracketed title... let's extract it (leaks a byte) */      /* bracketed title... let's extract it */
833      char * title = NULL;      char * title = NULL;
834      if (line->type == LT_TITLE) {      if (line->type == LT_TITLE) {
835   title = strdup(line->elements[0].item);   title = strdup(line->elements[0].item + 1);
  title++;  
836   *(title + strlen(title) - 1) = '\0';   *(title + strlen(title) - 1) = '\0';
837      } else if (line->type == LT_MENUENTRY)      } else if (line->type == LT_MENUENTRY)
838   title = strdup(line->elements[1].item);   title = strdup(line->elements[1].item);

Legend:
Removed from v.2976  
changed lines
  Added in v.2977