1 --- grub-0.90/stage2/stage2.c.append Thu Dec 20 08:20:48 2001
2 +++ grub-0.90/stage2/stage2.c Thu Dec 20 17:01:20 2001
6 Press enter to boot the selected OS, \'e\' to edit the\n\
7 - commands before booting, or \'c\' for a command-line.");
8 + commands before booting, \'a\' to modify the kernel arguments\n\
9 + before booting, or \'c\' for a command-line.");
12 Press \'b\' to boot, \'e\' to edit the selected command in the\n\
14 enter_cmdline (heap, 0);
17 + if (config_entries && c == 'a')
19 + int new_num_entries = 0, i = 0, j;
20 + int needs_padding, amount;
27 + entry_copy = new_heap = heap;
28 + cur_entry = get_entry (config_entries, first_entry + entryno,
33 + while ((*(new_heap++) = cur_entry[i++]) != 0);
36 + while (config_entries && cur_entry[i]);
38 + /* this only needs to be done if config_entries is non-NULL,
39 + but it doesn't hurt to do it always */
42 + new_heap = heap + NEW_HEAPSIZE + 1;
44 + entries = entry_copy;
47 + if ((strstr(entries, "kernel") == entries) &&
48 + isspace(entries[6]))
51 + while (*entries) entries++;
58 + start = entries + 6;
60 + /* skip the white space */
61 + while (*start && isspace(*start)) start++;
62 + /* skip the kernel name */
63 + while (*start && !isspace(*start)) start++;
65 + /* skip the white space */
66 + needs_padding = (!*start || !isspace(*start));
67 + while (*start && isspace(*start)) start++;
69 + append_line = new_heap;
70 + grub_strcpy(append_line, start);
73 + print_cmdline_message (CMDLINE_EDIT_MODE);
75 + if (get_cmdline(PACKAGE " append> ",
76 + append_line, NEW_HEAPSIZE + 1,
80 + /* have new args; append_line points to the
81 + new args and start points to the old
84 + i = grub_strlen(start);
85 + j = grub_strlen(append_line);
87 + if (i > (j + needs_padding))
90 + amount = j + needs_padding;
92 + /* align rest of commands properly */
93 + memmove (start + j + needs_padding, start + i,
94 + ((int) append_line) - ((int) start) - (amount));
99 + /* copy command to correct area */
100 + memmove (start + needs_padding, append_line, j);
102 + /* set up this entry to boot */
103 + config_entries = NULL;
104 + cur_entry = entry_copy;