From fbc7e8b244779d19386d616335398c5906b86294 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 31 Jan 2009 17:23:29 +0000 Subject: [PATCH] qi-strip-trailing-newlines-in-append-file.patch Signed-off-by: Andy Green --- qiboot/src/phase2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qiboot/src/phase2.c b/qiboot/src/phase2.c index b733444..dd15055 100644 --- a/qiboot/src/phase2.c +++ b/qiboot/src/phase2.c @@ -181,6 +181,7 @@ static void do_params(unsigned initramfs_len, (this_board->get_board_variant)(); const char *p; char * cmdline; + char * p1; struct tag *params = (struct tag *)this_board->linux_tag_placement; /* eat leading white space */ @@ -228,6 +229,12 @@ static void do_params(unsigned initramfs_len, cmdline += strlen(strcpy(cmdline, commandline_rootfs_append)); + /* deal with any trailing newlines that hitched a ride */ + + p1 = cmdline + strlen(cmdline) - 1; + while (*p1 == '\n') + *p1-- = '\0'; + /* * if he's still holding down the UI_ACTION_SKIPKERNEL key * now we finished loading the kernel, take it to mean he wants