From 3ff944cd7a5c3053d3514bbfae70d453dd6af58d Mon Sep 17 00:00:00 2001 From: Pascal Terjan <pterjan@mandriva.com> Date: Wed, 24 Jun 2009 19:07:01 +0200 Subject: [PATCH] Return the last kernel arg with given name Currently when typing "<entry name> root=/dev/foo" in lilo, the appended root= is ignored --- nash/nash.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nash/nash.c b/nash/nash.c index 823e21c..e127030 100644 --- a/nash/nash.c +++ b/nash/nash.c @@ -256,7 +256,7 @@ getKernelCmdLine(void) static char * getKernelArg(char * arg) { - char * start, * cmdline; + char * start, * cmdline, * pos = NULL; int len; cmdline = start = getKernelCmdLine(); @@ -272,15 +272,16 @@ getKernelArg(char * arg) this one */ if (strncmp(start, arg, len) == 0) { if (start[len] == '=') - return start + len + 1; - if (!start[len] || isspace(start[len])) - return start + len; + pos = start + len + 1; + else if (!start[len] || isspace(start[len])) + pos = start + len; } while (*++start && !isspace(*start)) ; } - return NULL; + + return pos; } static int -- 1.6.4.4