Magellan Linux

Diff of /trunk/grubby/grubby.c

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

revision 3024 by niro, Tue Jun 27 14:41:50 2017 UTC revision 3026 by niro, Tue Jun 27 14:43:04 2017 UTC
# Line 1712  static void writeDefault(FILE * out, cha Line 1712  static void writeDefault(FILE * out, cha
1712   fprintf(out, "%sset default=\"${saved_entry}\"\n", indent);   fprintf(out, "%sset default=\"${saved_entry}\"\n", indent);
1713   if (cfg->defaultImage >= FIRST_ENTRY_INDEX && cfg->cfi->setEnv) {   if (cfg->defaultImage >= FIRST_ENTRY_INDEX && cfg->cfi->setEnv) {
1714   char *title;   char *title;
1715   entry = findEntryByIndex(cfg, cfg->defaultImage);   int trueIndex, currentIndex;
1716    
1717     trueIndex = 0;
1718     currentIndex = 0;
1719    
1720     while ((entry = findEntryByIndex(cfg, currentIndex))) {
1721     if (!entry->skip) {
1722     if (trueIndex == cfg->defaultImage) {
1723     break;
1724     }
1725     trueIndex++;
1726     }
1727     currentIndex++;
1728     }
1729   line = getLineByType(LT_MENUENTRY, entry->lines);   line = getLineByType(LT_MENUENTRY, entry->lines);
1730   if (!line)   if (!line)
1731   line = getLineByType(LT_TITLE, entry->lines);   line = getLineByType(LT_TITLE, entry->lines);
# Line 2556  void setDefaultImage(struct grubConfig * Line 2569  void setDefaultImage(struct grubConfig *
2569   /* check validity of existing default or first-entry-found   /* check validity of existing default or first-entry-found
2570     selection */     selection */
2571   if (defaultKernelPath) {   if (defaultKernelPath) {
2572                    /* we must initialize this */
2573                    firstKernelEntryIndex = 0;
2574   /* user requested first-entry-found */   /* user requested first-entry-found */
2575   if (!findEntryByPath(config, defaultKernelPath,   if (!findEntryByPath(config, defaultKernelPath,
2576       prefix, &firstKernelEntryIndex)) {       prefix, &firstKernelEntryIndex)) {

Legend:
Removed from v.3024  
changed lines
  Added in v.3026