1 2006-03-09 Alexandre Oliva <oliva@gnu.org>
3 * lib/builtins.c (install_blocklist_helper): Move static
5 (install_func_context): ... here.
6 (install_func): Reset it.
8 Index: grub-0.97/stage2/builtins.c
9 ===================================================================
10 --- grub-0.97.orig/stage2/builtins.c 2006-03-09 10:26:41.000000000 -0300
11 +++ grub-0.97/stage2/builtins.c 2006-03-09 11:36:18.000000000 -0300
12 @@ -1926,11 +1926,13 @@ static struct {
17 char *stage2_first_buffer;
18 } install_func_context = {
22 + .last_length = SECTOR_SIZE,
23 .stage2_first_buffer = NULL,
26 @@ -1960,19 +1962,19 @@ install_blocklist_helper (int sector, in
27 int *installlist = &install_func_context.installlist;
28 char **stage2_first_buffer = &install_func_context.stage2_first_buffer;
29 /* Was the last sector full? */
30 - static int last_length = SECTOR_SIZE;
31 + int *last_length = &install_func_context.last_length;
34 printf("[%d]", sector);
36 - if (offset != 0 || last_length != SECTOR_SIZE)
37 + if (offset != 0 || *last_length != SECTOR_SIZE)
39 /* We found a non-sector-aligned data block. */
40 errnum = ERR_UNALIGNED;
44 - last_length = length;
45 + *last_length = length;
47 if (*((unsigned long *) (*installlist - 4))
48 + *((unsigned short *) *installlist) != sector
49 @@ -2027,7 +2029,11 @@ install_func (char *arg, int flags)
51 /* If LBA is forced? */
53 + int *last_length = &install_func_context.last_length;
56 + *last_length = SECTOR_SIZE;
58 *stage2_first_buffer = old_sect + SECTOR_SIZE;
60 /* If the Stage 2 is in a partition mounted by an OS, this will store