if (os_name && os_id && (os_version || os_build)) {
CHAR16 *conf;
CHAR16 *path;
- CHAR16 *cmdline;
conf = PoolPrint(L"%s-%s", os_id, os_version ? : os_build);
path = PoolPrint(L"\\EFI\\Linux\\%s", f->FileName);
FreePool(content);
content = NULL;
/* read the embedded cmdline file */
- err = file_read(linux_dir, f->FileName, offs[1], szs[1] - 1, &content, NULL);
+ err = file_read(linux_dir, f->FileName, offs[1], szs[1], &content, NULL);
if (!EFI_ERROR(err)) {
- cmdline = stra_to_str(content);
- entry->options = cmdline;
- cmdline = NULL;
+
+ /* chomp the newline */
+ if (content[szs[1]-1] == '\n')
+ content[szs[1]-1] = '\0';
+
+ entry->options = stra_to_str(content);
}
- FreePool(cmdline);
+
FreePool(conf);
FreePool(path);
}