[PATCH 2/4] Fix not-found default entry when reading config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fix does two things
	(1) When reading the configuration file it resets entry to NULL
	    on every pass, thus clearing the value out on each pass to
	    make sure it's existance doesn't get propigated.

	(2) Adds a better check for entry's existance once the reading
	    is done.  This check will now either set the default image
	    to the entry (same as before) or set it to -1 which is the
	    expected error or not found code

Signed-off-by: John 'Warthog9' Hawley <warthog9@xxxxxxxxxxxxxx>
---
 grubby/grubby.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/grubby/grubby.c b/grubby/grubby.c
index 1e4ba98..9299063 100644
--- a/grubby/grubby.c
+++ b/grubby/grubby.c
@@ -869,9 +869,14 @@ static struct grubConfig * readConfig(const char * inName,
                                 extractTitle(line))) break;
                 }
 		i++;
+		entry = NULL;
 	    }
 
-	    if (entry) cfg->defaultImage = i;
+	    if (entry){
+	        cfg->defaultImage = i;
+	    }else{
+	        cfg->defaultImage = -1;
+	    }
 	}
     } else {
         cfg->defaultImage = 0;
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux