Skip to content

Commit

Permalink
. 修正 setmenu --string 函数不解析转义符的错误。(issues #222)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaya committed Dec 24, 2019
1 parent dc5f13b commit f53d854
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions stage2/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -16594,15 +16594,19 @@ setmenu_func(char *arg, int flags)
else
strings[i].start_x = menu_border.menu_box_x + ((menu_border.menu_box_w - num_text_char(arg)) >> 1);
}
parse_string(arg);
p = strings[i].string;
while (*arg && (p - strings[i].string) < 99)
*p++ = *arg++;
*p = 0;
p = strings[i].string;
if (DateTime_enable == i + 1)
{
while(*p++ != '=');
*(p - 1) = 0;
while(*p && *p++ != '=');
if (*(p - 1) == '=')
*(p - 1) = 0;
else
*(p + 1) = 0;
}
num_string++;
arg++;
Expand Down Expand Up @@ -16987,7 +16991,7 @@ void DateTime_refresh(void)
min = time >> 16;
sec = time >> 8;
p = (char *)strings[i].string;
if (!*p)
if (!*(p+1))
grub_printf("%04X-%02d-%02X %02d:%02X:%02X", year, month, day, hour, min, sec);
else
{
Expand Down

0 comments on commit f53d854

Please sign in to comment.