mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-25 18:09:37 +03:00
menu: Fix issue where command line buffer was allocated in conventional memory and subsequently discarded
This commit is contained in:
parent
9b7f9e4209
commit
4c09663a28
BIN
limine-pxe.bin
BIN
limine-pxe.bin
Binary file not shown.
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
BIN
stage2.map
BIN
stage2.map
Binary file not shown.
@ -37,9 +37,6 @@ static void cursor_fwd(void) {
|
||||
set_cursor_pos(x, y);
|
||||
}
|
||||
|
||||
static char *cmdline;
|
||||
#define CMDLINE_MAX 1024
|
||||
|
||||
#define EDITOR_MAX_BUFFER_SIZE 4096
|
||||
|
||||
static size_t get_line_offset(size_t *displacement, size_t index, const char *buffer) {
|
||||
@ -241,9 +238,7 @@ static int print_tree(int level, int base_index, int selected_entry,
|
||||
return max_entries;
|
||||
}
|
||||
|
||||
char *menu(char **cmdline_ret) {
|
||||
cmdline = conv_mem_alloc(CMDLINE_MAX);
|
||||
|
||||
char *menu(char **cmdline) {
|
||||
struct menu_entry *selected_menu_entry;
|
||||
|
||||
int selected_entry = 0;
|
||||
@ -380,15 +375,14 @@ timeout_aborted:
|
||||
goto refresh;
|
||||
}
|
||||
enable_cursor();
|
||||
cmdline = config_get_value(selected_menu_entry->body, 0, "KERNEL_CMDLINE");
|
||||
if (!cmdline) {
|
||||
cmdline = config_get_value(selected_menu_entry->body, 0, "CMDLINE");
|
||||
*cmdline = config_get_value(selected_menu_entry->body, 0, "KERNEL_CMDLINE");
|
||||
if (!*cmdline) {
|
||||
*cmdline = config_get_value(selected_menu_entry->body, 0, "CMDLINE");
|
||||
}
|
||||
if (!cmdline) {
|
||||
cmdline[0] = '\0';
|
||||
if (!*cmdline) {
|
||||
*cmdline = "";
|
||||
}
|
||||
clear(true);
|
||||
*cmdline_ret = cmdline;
|
||||
term_double_buffer(false);
|
||||
return selected_menu_entry->body;
|
||||
case 'e': {
|
||||
|
Loading…
Reference in New Issue
Block a user