Blame SOURCES/0021-Make-findTemplate-actually-return-the-saved-default.patch

56d25d
From e990379f5c3c2a2ffe9b9e4a1afae0df0d8dcf80 Mon Sep 17 00:00:00 2001
775cb0
From: Peter Jones <pjones@redhat.com>
775cb0
Date: Mon, 15 Sep 2014 14:31:01 -0400
56d25d
Subject: [PATCH 21/41] Make findTemplate actually return the saved default.
775cb0
775cb0
Really not sure why this wasn't returning here before; going into the
775cb0
loop below is just going to clobber all that it's done.
775cb0
775cb0
Related: rhbz#957681
775cb0
Signed-off-by: Peter Jones <pjones@redhat.com>
775cb0
---
775cb0
 grubby.c | 6 +++++-
775cb0
 1 file changed, 5 insertions(+), 1 deletion(-)
775cb0
775cb0
diff --git a/grubby.c b/grubby.c
56d25d
index 4462fb9..6670ff0 100644
775cb0
--- a/grubby.c
775cb0
+++ b/grubby.c
56d25d
@@ -2114,8 +2114,12 @@ struct singleEntry * findTemplate(struct grubConfig * cfg, const char * prefix,
775cb0
 		} else {
775cb0
 		    entry = findEntryByTitle(cfg, defTitle, &index);
775cb0
 		}
775cb0
-		if (entry)
775cb0
+		if (entry && suitableImage(entry, prefix, skipRemoved, flags)) {
775cb0
 		    cfg->defaultImage = index;
775cb0
+		    if (indexPtr)
775cb0
+			*indexPtr = index;
775cb0
+		    return entry;
775cb0
+		}
775cb0
 	    }
775cb0
 	}
775cb0
     } else if (cfg->defaultImage > -1) {
775cb0
-- 
56d25d
2.4.3
775cb0