Permalink
Browse files

. 修正 color 及 setmenu 函数。(issues #163, #164)

  • Loading branch information...
yaya
yaya committed Dec 23, 2017
1 parent d275720 commit 05379e7b66b71e5665bc5bedda75a58ca74c485a
Showing with 21 additions and 3 deletions.
  1. +16 −0 stage2/builtins.c
  2. +2 −2 stage2/dec_vhd.c
  3. +3 −1 stage2/stage2.c
View
@@ -16291,6 +16291,7 @@ char graphic_file[128];
struct box DrawBox[16];
struct string strings[16];
char *p_string= (char *)MENU_TITLE;
extern int new_menu;
unsigned long string_total = 0;
static int
@@ -16300,6 +16301,17 @@ setmenu_func(char *arg, int flags)
unsigned long long val;
struct border tmp_broder = {218,191,192,217,196,179,2,0,2,0,0,2,0,0,0};
if (new_menu == 0)
{
num_string = 0;
string_total = 0;
p_string = (char *)MENU_TITLE;
int i;
for (i=0; i<16; i++)
DrawBox[i].index = 0;
new_menu = 1;
}
for (; *arg && *arg != '\n' && *arg != '\r';)
{
if (grub_memcmp (arg, "--string=", 9) == 0)
@@ -16318,6 +16330,8 @@ setmenu_func(char *arg, int flags)
else
{
num_string = 0;
string_total = 0;
p_string = (char *)MENU_TITLE;
errorcheck_func ("on",0);
goto cont;
}
@@ -16402,6 +16416,8 @@ setmenu_func(char *arg, int flags)
int i;
menu_tab = 0;
num_string = 0;
string_total = 0;
p_string= (char *)MENU_TITLE;
menu_font_spacing = 0;
menu_line_spacing = 0;
font_spacing = 0;
View
@@ -182,7 +182,7 @@ dec_vhd_open(void)
memset(&footer, 0, sizeof(footer));
memset(&dynaheader, 0, sizeof(dynaheader));
int bytesread = (int)grub_read((unsigned long)&footer, 0x200, 0xedde0d90);
//int bytesread = (int)grub_read((unsigned long)&footer, 0x200, 0xedde0d90);
//if (bytesread < 511) {
// grub_printf("bytesread %d < 511\n",bytesread);
@@ -206,7 +206,7 @@ dec_vhd_open(void)
goto quit;
}
filepos = footer.dataOffset;
bytesread = (int)grub_read((unsigned long)&dynaheader, sizeof(dynaheader), 0xedde0d90);
//bytesread = (int)grub_read((unsigned long)&dynaheader, sizeof(dynaheader), 0xedde0d90);
// }
vhdfc = (VHDFileControl*) grub_malloc(sizeof(VHDFileControl));
View
@@ -690,6 +690,7 @@ run_script (char *script, char *heap)
return 1; /* use fallback. */
}
int new_menu;
int color_counting;
int password_x;
static int fallbacked_entries;
@@ -703,6 +704,7 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h
char *cur_entry = 0;
char *pass_config = 0;
color_counting = 0;
new_menu = 0;
// struct term_entry *prev_term = NULL;
@@ -831,7 +833,7 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h
int start_offcet = 0;
i = num_string;
for (j=0; j<i+1;j++)
for (j=0; j<i; j++)
{
if((menu_tab & 0x40))
start_offcet = current_term->chars_per_line - strings[j].start_x - num_text_char((char *)strings[j].addr);

0 comments on commit 05379e7

Please sign in to comment.