Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 85779 | Differences between
and this patch

Collapse All | Expand All

(-)grub-0.96.dirs/docs/grub.texi (+37 lines)
Lines 2121-2126 Link Here
2121
* gfxmenu::                     Use graphical menu interface
2121
* gfxmenu::                     Use graphical menu interface
2122
* timeout::                     Set the timeout
2122
* timeout::                     Set the timeout
2123
* title::                       Start a menu entry
2123
* title::                       Start a menu entry
2124
* wildcard::                    Define a wildcard boot entry
2124
@end menu
2125
@end menu
2125
2126
2126
2127
Lines 2190-2195 Link Here
2190
@end deffn
2191
@end deffn
2191
2192
2192
2193
2194
@node wildcard
2195
@subsection wildcard
2196
2197
@deffn Command wildcard pathname
2198
Treat this boot entry as a wildcard entry: The
2199
wildcard, title, kernel, and initrd commands (see @ref{Menu-specific
2200
commands} and @ref{Command-line and menu entry commands}) each have an
2201
asterisk (*) in their value. A filename match is performed on the
2202
@var{pathname} of the wildcard command. For each match, the entire boot
2203
entry is duplicated. The part of the filename whcih matches the asterisk
2204
in the wildcard command replaces the asterisks in the title, kernel, and
2205
initrd commands. For example, with the files vmlinuz-2.6.5-1 and
2206
vmlinuz-2.6.8-8 below (hd0,7)/boot, the following entry in the stage 2
2207
configuration file:
2208
2209
@example
2210
title Linux-*
2211
    wildcard (hd0,7)/boot/vmlinuz-*
2212
    kernel (hd0,7)/boot/vmlinuz-* root=/dev/hda8
2213
    initrd (hd0,7)/boot/initrd-*
2214
@end example
2215
2216
would expand as follows:
2217
2218
@example
2219
title Linux-2.6.5-1
2220
    wildcard (hd0,7)/boot/vmlinuz-2.6.5-1
2221
    kernel (hd0,7)/boot/vmlinuz-2.6.5-1 root=/dev/hda8
2222
    initrd (hd0,7)/boot/initrd-2.6.5-1
2223
title Linux-2.6.8-8
2224
    wildcard (hd0,7)/boot/vmlinuz-2.6.8-8
2225
    kernel (hd0,7)/boot/vmlinuz-2.6.8-8 root=/dev/hda8
2226
    initrd (hd0,7)/boot/initrd-2.6.8-8
2227
@end example
2228
@end deffn
2229
2193
@node General commands
2230
@node General commands
2194
@section The list of general commands
2231
@section The list of general commands
2195
2232
(-)grub-0.96.dirs/netboot/fsys_tftp.c (-2 / +2 lines)
Lines 409-415 Link Here
409
/* Check if the file DIRNAME really exists. Get the size and save it in
409
/* Check if the file DIRNAME really exists. Get the size and save it in
410
   FILEMAX.  */
410
   FILEMAX.  */
411
int
411
int
412
tftp_dir (char *dirname)
412
tftp_dir (char *dirname, void (*handle)(char *))
413
{
413
{
414
  int ch;
414
  int ch;
415
415
Lines 418-424 Link Here
418
#endif
418
#endif
419
  
419
  
420
  /* In TFTP, there is no way to know what files exist.  */
420
  /* In TFTP, there is no way to know what files exist.  */
421
  if (print_possibilities)
421
  if (handle)
422
    return 1;
422
    return 1;
423
423
424
  /* Don't know the size yet.  */
424
  /* Don't know the size yet.  */
(-)grub-0.96.dirs/stage2/builtins.c (+44 lines)
Lines 4816-4821 Link Here
4816
};
4816
};
4817
  
4817
  
4818
4818
4819
/* wildcard */
4820
 static int
4821
wildcard_func (char *arg, int flags)
4822
{
4823
#ifdef DEBUG_WILDCARD
4824
  char *w = wildcard (arg);
4825
4826
  if (w)
4827
    {
4828
      while (*w)
4829
       {
4830
         grub_printf("%s  ", w);
4831
         w += strlen (w) + 1;
4832
        }
4833
      grub_printf("\n");
4834
      return 1;
4835
    }
4836
  else
4837
    print_error();
4838
#endif
4839
4840
  /* This special command is interpreted in the config file parser. */
4841
  return 0;
4842
}
4843
4844
static struct builtin builtin_wildcard =
4845
 {
4846
  "wildcard",
4847
  wildcard_func,
4848
#ifndef DEBUG_WILDCARD
4849
  BUILTIN_MENU,
4850
#else
4851
  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
4852
  "wildcard GLOB",
4853
  "Declare this menu entry as a wildcard entry. GLOB is a path containing"
4854
  " one asterisk. All files matching this expression are looked up; the"
4855
  " menu entry is duplicated for each match with asterisks in other"
4856
  " commands replaced by the string matching the asterisk in the wildcard"
4857
  " command."
4858
#endif
4859
};
4860
4861
4819
/* The table of builtin commands. Sorted in dictionary order.  */
4862
/* The table of builtin commands. Sorted in dictionary order.  */
4820
struct builtin *builtin_table[] =
4863
struct builtin *builtin_table[] =
4821
{
4864
{
Lines 4905-4909 Link Here
4905
  &builtin_unhide,
4948
  &builtin_unhide,
4906
  &builtin_uppermem,
4949
  &builtin_uppermem,
4907
  &builtin_vbeprobe,
4950
  &builtin_vbeprobe,
4951
  &builtin_wildcard,
4908
  0
4952
  0
4909
};
4953
};
(-)grub-0.96.dirs/stage2/disk_io.c (-20 / +13 lines)
Lines 36-42 Link Here
36
void (*disk_read_func) (int, int, int) = NULL;
36
void (*disk_read_func) (int, int, int) = NULL;
37
37
38
#ifndef STAGE1_5
38
#ifndef STAGE1_5
39
int print_possibilities;
40
39
41
static int do_completion;
40
static int do_completion;
42
static int unique;
41
static int unique;
Lines 1479-1485 Link Here
1479
	  if (! is_completion)
1478
	  if (! is_completion)
1480
	    grub_printf (" Possible files are:");
1479
	    grub_printf (" Possible files are:");
1481
	  
1480
	  
1482
	  dir (buf);
1481
	  dir (buf, print_a_completion);
1483
	  
1482
	  
1484
	  if (is_completion && *unique_string)
1483
	  if (is_completion && *unique_string)
1485
	    {
1484
	    {
Lines 1498-1504 Link Here
1498
		  *ptr = '/';
1497
		  *ptr = '/';
1499
		  *(ptr + 1) = 0;
1498
		  *(ptr + 1) = 0;
1500
		  
1499
		  
1501
		  dir (buf);
1500
		  dir (buf, print_a_completion);
1502
		  
1501
		  
1503
		  /* Restore the original unique value.  */
1502
		  /* Restore the original unique value.  */
1504
		  unique = 1;
1503
		  unique = 1;
Lines 1626-1637 Link Here
1626
  if (!errnum && fsys_type == NUM_FSYS)
1625
  if (!errnum && fsys_type == NUM_FSYS)
1627
    errnum = ERR_FSYS_MOUNT;
1626
    errnum = ERR_FSYS_MOUNT;
1628
1627
1629
# ifndef STAGE1_5
1628
  if (!errnum && (*(fsys_table[fsys_type].dir_func)) (filename, NULL))
1630
  /* set "dir" function to open a file */
1631
  print_possibilities = 0;
1632
# endif
1633
1634
  if (!errnum && (*(fsys_table[fsys_type].dir_func)) (filename))
1635
    {
1629
    {
1636
#ifndef NO_DECOMPRESSION
1630
#ifndef NO_DECOMPRESSION
1637
      return gunzip_test_header ();
1631
      return gunzip_test_header ();
Lines 1752-1758 Link Here
1752
}
1746
}
1753
1747
1754
int
1748
int
1755
dir (char *dirname)
1749
dir (char *dirname, void (*handle)(char *))
1756
{
1750
{
1757
#ifndef NO_DECOMPRESSION
1751
#ifndef NO_DECOMPRESSION
1758
  compressed_file = 0;
1752
  compressed_file = 0;
Lines 1761-1779 Link Here
1761
  if (!(dirname = setup_part (dirname)))
1755
  if (!(dirname = setup_part (dirname)))
1762
    return 0;
1756
    return 0;
1763
1757
1758
  errnum = 0;
1764
  if (*dirname != '/')
1759
  if (*dirname != '/')
1765
    errnum = ERR_BAD_FILENAME;
1760
    errnum = ERR_BAD_FILENAME;
1766
1761
  else if (fsys_type == NUM_FSYS)
1767
  if (fsys_type == NUM_FSYS)
1768
    errnum = ERR_FSYS_MOUNT;
1762
    errnum = ERR_FSYS_MOUNT;
1769
1763
  else
1770
  if (errnum)
1764
    {
1771
    return 0;
1765
      fsys_table[fsys_type].dir_func (dirname, handle);
1772
1766
      if (errnum == ERR_FILE_NOT_FOUND)
1773
  /* set "dir" function to list completions */
1767
	errnum = 0;
1774
  print_possibilities = 1;
1768
    }
1775
1769
  return errnum == 0;
1776
  return (*(fsys_table[fsys_type].dir_func)) (dirname);
1777
}
1770
}
1778
#endif /* STAGE1_5 */
1771
#endif /* STAGE1_5 */
1779
1772
(-)grub-0.96.dirs/stage2/filesys.h (-18 / +12 lines)
Lines 24-30 Link Here
24
#define FSYS_FFS_NUM 1
24
#define FSYS_FFS_NUM 1
25
int ffs_mount (void);
25
int ffs_mount (void);
26
int ffs_read (char *buf, int len);
26
int ffs_read (char *buf, int len);
27
int ffs_dir (char *dirname);
27
int ffs_dir (char *dirname, void (*handle)(char *));
28
int ffs_embed (int *start_sector, int needed_sectors);
28
int ffs_embed (int *start_sector, int needed_sectors);
29
#else
29
#else
30
#define FSYS_FFS_NUM 0
30
#define FSYS_FFS_NUM 0
Lines 34-40 Link Here
34
#define FSYS_UFS2_NUM 1
34
#define FSYS_UFS2_NUM 1
35
int ufs2_mount (void);
35
int ufs2_mount (void);
36
int ufs2_read (char *buf, int len);
36
int ufs2_read (char *buf, int len);
37
int ufs2_dir (char *dirname);
37
int ufs2_dir (char *dirname, void (*handle)(char *));
38
int ufs2_embed (int *start_sector, int needed_sectors);
38
int ufs2_embed (int *start_sector, int needed_sectors);
39
#else
39
#else
40
#define FSYS_UFS2_NUM 0
40
#define FSYS_UFS2_NUM 0
Lines 44-50 Link Here
44
#define FSYS_FAT_NUM 1
44
#define FSYS_FAT_NUM 1
45
int fat_mount (void);
45
int fat_mount (void);
46
int fat_read (char *buf, int len);
46
int fat_read (char *buf, int len);
47
int fat_dir (char *dirname);
47
int fat_dir (char *dirname, void (*handle)(char *));
48
#else
48
#else
49
#define FSYS_FAT_NUM 0
49
#define FSYS_FAT_NUM 0
50
#endif
50
#endif
Lines 53-59 Link Here
53
#define FSYS_EXT2FS_NUM 1
53
#define FSYS_EXT2FS_NUM 1
54
int ext2fs_mount (void);
54
int ext2fs_mount (void);
55
int ext2fs_read (char *buf, int len);
55
int ext2fs_read (char *buf, int len);
56
int ext2fs_dir (char *dirname);
56
int ext2fs_dir (char *dirname, void (*handle)(char *));
57
#else
57
#else
58
#define FSYS_EXT2FS_NUM 0
58
#define FSYS_EXT2FS_NUM 0
59
#endif
59
#endif
Lines 62-68 Link Here
62
#define FSYS_MINIX_NUM 1
62
#define FSYS_MINIX_NUM 1
63
int minix_mount (void);
63
int minix_mount (void);
64
int minix_read (char *buf, int len);
64
int minix_read (char *buf, int len);
65
int minix_dir (char *dirname);
65
int minix_dir (char *dirname, void (*handle)(char *));
66
#else
66
#else
67
#define FSYS_MINIX_NUM 0
67
#define FSYS_MINIX_NUM 0
68
#endif
68
#endif
Lines 71-77 Link Here
71
#define FSYS_REISERFS_NUM 1
71
#define FSYS_REISERFS_NUM 1
72
int reiserfs_mount (void);
72
int reiserfs_mount (void);
73
int reiserfs_read (char *buf, int len);
73
int reiserfs_read (char *buf, int len);
74
int reiserfs_dir (char *dirname);
74
int reiserfs_dir (char *dirname, void (*handle)(char *));
75
int reiserfs_embed (int *start_sector, int needed_sectors);
75
int reiserfs_embed (int *start_sector, int needed_sectors);
76
#if defined(__linux__) && defined (GRUB_UTIL)
76
#if defined(__linux__) && defined (GRUB_UTIL)
77
#include <sys/types.h>
77
#include <sys/types.h>
Lines 91-97 Link Here
91
#define FSYS_VSTAFS_NUM 1
91
#define FSYS_VSTAFS_NUM 1
92
int vstafs_mount (void);
92
int vstafs_mount (void);
93
int vstafs_read (char *buf, int len);
93
int vstafs_read (char *buf, int len);
94
int vstafs_dir (char *dirname);
94
int vstafs_dir (char *dirname, void (*handle)(char *));
95
#else
95
#else
96
#define FSYS_VSTAFS_NUM 0
96
#define FSYS_VSTAFS_NUM 0
97
#endif
97
#endif
Lines 100-106 Link Here
100
#define FSYS_JFS_NUM 1
100
#define FSYS_JFS_NUM 1
101
int jfs_mount (void);
101
int jfs_mount (void);
102
int jfs_read (char *buf, int len);
102
int jfs_read (char *buf, int len);
103
int jfs_dir (char *dirname);
103
int jfs_dir (char *dirname, void (*handle)(char *));
104
int jfs_embed (int *start_sector, int needed_sectors);
104
int jfs_embed (int *start_sector, int needed_sectors);
105
#else
105
#else
106
#define FSYS_JFS_NUM 0
106
#define FSYS_JFS_NUM 0
Lines 110-116 Link Here
110
#define FSYS_XFS_NUM 1
110
#define FSYS_XFS_NUM 1
111
int xfs_mount (void);
111
int xfs_mount (void);
112
int xfs_read (char *buf, int len);
112
int xfs_read (char *buf, int len);
113
int xfs_dir (char *dirname);
113
int xfs_dir (char *dirname, void (*handle)(char *));
114
#else
114
#else
115
#define FSYS_XFS_NUM 0
115
#define FSYS_XFS_NUM 0
116
#endif
116
#endif
Lines 119-125 Link Here
119
#define FSYS_TFTP_NUM 1
119
#define FSYS_TFTP_NUM 1
120
int tftp_mount (void);
120
int tftp_mount (void);
121
int tftp_read (char *buf, int len);
121
int tftp_read (char *buf, int len);
122
int tftp_dir (char *dirname);
122
int tftp_dir (char *dirname, void (*handle)(char *));
123
void tftp_close (void);
123
void tftp_close (void);
124
#else
124
#else
125
#define FSYS_TFTP_NUM 0
125
#define FSYS_TFTP_NUM 0
Lines 129-135 Link Here
129
#define FSYS_ISO9660_NUM 1
129
#define FSYS_ISO9660_NUM 1
130
int iso9660_mount (void);
130
int iso9660_mount (void);
131
int iso9660_read (char *buf, int len);
131
int iso9660_read (char *buf, int len);
132
int iso9660_dir (char *dirname);
132
int iso9660_dir (char *dirname, void (*handle)(char *));
133
#else
133
#else
134
#define FSYS_ISO9660_NUM 0
134
#define FSYS_ISO9660_NUM 0
135
#endif
135
#endif
Lines 160-175 Link Here
160
  char *name;
160
  char *name;
161
  int (*mount_func) (void);
161
  int (*mount_func) (void);
162
  int (*read_func) (char *buf, int len);
162
  int (*read_func) (char *buf, int len);
163
  int (*dir_func) (char *dirname);
163
  int (*dir_func) (char *dirname, void (*print_one)(char *));
164
  void (*close_func) (void);
164
  void (*close_func) (void);
165
  int (*embed_func) (int *start_sector, int needed_sectors);
165
  int (*embed_func) (int *start_sector, int needed_sectors);
166
};
166
};
167
167
168
#ifdef STAGE1_5
169
# define print_possibilities 0
170
#else
171
extern int print_possibilities;
172
#endif
173
174
extern int fsmax;
168
extern int fsmax;
175
extern struct fsys_entry fsys_table[NUM_FSYS + 1];
169
extern struct fsys_entry fsys_table[NUM_FSYS + 1];
(-)grub-0.96.dirs/stage2/fsys_ext2fs.c (-22 / +7 lines)
Lines 495-501 Link Here
495
 * side effects: messes up GROUP_DESC buffer area
495
 * side effects: messes up GROUP_DESC buffer area
496
 */
496
 */
497
int
497
int
498
ext2fs_dir (char *dirname)
498
ext2fs_dir (char *dirname, void (*handle)(char *))
499
{
499
{
500
  int current_ino = EXT2_ROOT_INO;	/* start at the root */
500
  int current_ino = EXT2_ROOT_INO;	/* start at the root */
501
  int updir_ino = current_ino;	/* the parent of the current directory */
501
  int updir_ino = current_ino;	/* the parent of the current directory */
Lines 521-527 Link Here
521
#ifdef E2DEBUG
521
#ifdef E2DEBUG
522
  unsigned char *i;
522
  unsigned char *i;
523
#endif	/* E2DEBUG */
523
#endif	/* E2DEBUG */
524
525
  /* loop invariants:
524
  /* loop invariants:
526
     current_ino = inode to lookup
525
     current_ino = inode to lookup
527
     dirname = pointer to filename component we are cur looking up within
526
     dirname = pointer to filename component we are cur looking up within
Lines 713-730 Link Here
713
	     give up */
712
	     give up */
714
	  if (loc >= INODE->i_size)
713
	  if (loc >= INODE->i_size)
715
	    {
714
	    {
716
	      if (print_possibilities < 0)
715
	      errnum = ERR_FILE_NOT_FOUND;
717
		{
716
	      *rest = ch;
718
# if 0
717
	      return 0;
719
		  putchar ('\n');
720
# endif
721
		}
722
	      else
723
		{
724
		  errnum = ERR_FILE_NOT_FOUND;
725
		  *rest = ch;
726
		}
727
	      return (print_possibilities < 0);
728
	    }
718
	    }
729
719
730
	  /* else, find the (logical) block component of our location */
720
	  /* else, find the (logical) block component of our location */
Lines 765-784 Link Here
765
	      str_chk = substring (dirname, dp->name);
755
	      str_chk = substring (dirname, dp->name);
766
756
767
# ifndef STAGE1_5
757
# ifndef STAGE1_5
768
	      if (print_possibilities && ch != '/'
758
	      if (handle && ch != '/' && (!*dirname || str_chk <= 0))
769
		  && (!*dirname || str_chk <= 0))
759
		handle (dp->name);
770
		{
771
		  if (print_possibilities > 0)
772
		    print_possibilities = -print_possibilities;
773
		  print_a_completion (dp->name);
774
		}
775
# endif
760
# endif
776
761
777
	      dp->name[dp->name_len] = saved_c;
762
	      dp->name[dp->name_len] = saved_c;
778
	    }
763
	    }
779
764
780
	}
765
	}
781
      while (!dp->inode || (str_chk || (print_possibilities && ch != '/')));
766
      while (!dp->inode || (str_chk || (handle && ch != '/')));
782
767
783
      current_ino = dp->inode;
768
      current_ino = dp->inode;
784
      *(dirname = rest) = ch;
769
      *(dirname = rest) = ch;
(-)grub-0.96.dirs/stage2/fsys_fat.c (-17 / +3 lines)
Lines 286-292 Link Here
286
}
286
}
287
287
288
int
288
int
289
fat_dir (char *dirname)
289
fat_dir (char *dirname, void (*handle)(char *))
290
{
290
{
291
  char *rest, ch, dir_buf[FAT_DIRENTRY_LENGTH];
291
  char *rest, ch, dir_buf[FAT_DIRENTRY_LENGTH];
292
  char *filename = (char *) NAME_BUF;
292
  char *filename = (char *) NAME_BUF;
Lines 342-348 Link Here
342
  *rest = 0;
342
  *rest = 0;
343
  
343
  
344
# ifndef STAGE1_5
344
# ifndef STAGE1_5
345
  if (print_possibilities && ch != '/')
345
  if (handle && ch != '/')
346
    do_possibilities = 1;
346
    do_possibilities = 1;
347
# endif
347
# endif
348
  
348
  
Lines 353-368 Link Here
353
	{
353
	{
354
	  if (!errnum)
354
	  if (!errnum)
355
	    {
355
	    {
356
# ifndef STAGE1_5
357
	      if (print_possibilities < 0)
358
		{
359
#if 0
360
		  putchar ('\n');
361
#endif
362
		  return 1;
363
		}
364
# endif /* STAGE1_5 */
365
	      
366
	      errnum = ERR_FILE_NOT_FOUND;
356
	      errnum = ERR_FILE_NOT_FOUND;
367
	      *rest = ch;
357
	      *rest = ch;
368
	    }
358
	    }
Lines 457-467 Link Here
457
	{
447
	{
458
	print_filename:
448
	print_filename:
459
	  if (substring (dirname, filename) <= 0)
449
	  if (substring (dirname, filename) <= 0)
460
	    {
450
	    handle (filename);
461
	      if (print_possibilities > 0)
462
		print_possibilities = -print_possibilities;
463
	      print_a_completion (filename);
464
	    }
465
	  continue;
451
	  continue;
466
	}
452
	}
467
# endif /* STAGE1_5 */
453
# endif /* STAGE1_5 */
(-)grub-0.96.dirs/stage2/fsys_ffs.c (-16 / +4 lines)
Lines 180-186 Link Here
180
180
181
181
182
int
182
int
183
ffs_dir (char *dirname)
183
ffs_dir (char *dirname, void (*handle)(char *))
184
{
184
{
185
  char *rest, ch;
185
  char *rest, ch;
186
  int block, off, loc, map, ino = ROOTINO;
186
  int block, off, loc, map, ino = ROOTINO;
Lines 236-248 Link Here
236
    {
236
    {
237
      if (loc >= INODE->i_size)
237
      if (loc >= INODE->i_size)
238
	{
238
	{
239
#if 0
240
	  putchar ('\n');
241
#endif
242
243
	  if (print_possibilities < 0)
244
	    return 1;
245
246
	  errnum = ERR_FILE_NOT_FOUND;
239
	  errnum = ERR_FILE_NOT_FOUND;
247
	  *rest = ch;
240
	  *rest = ch;
248
	  return 0;
241
	  return 0;
Lines 267-284 Link Here
267
      loc += dp->d_reclen;
260
      loc += dp->d_reclen;
268
261
269
#ifndef STAGE1_5
262
#ifndef STAGE1_5
270
      if (dp->d_ino && print_possibilities && ch != '/'
263
      if (dp->d_ino && handle && ch != '/'
271
	  && (!*dirname || substring (dirname, dp->d_name) <= 0))
264
	  && (!*dirname || substring (dirname, dp->d_name) <= 0))
272
	{
265
	handle (dp->d_name);
273
	  if (print_possibilities > 0)
274
	    print_possibilities = -print_possibilities;
275
276
	  print_a_completion (dp->d_name);
277
	}
278
#endif /* STAGE1_5 */
266
#endif /* STAGE1_5 */
279
    }
267
    }
280
  while (!dp->d_ino || (substring (dirname, dp->d_name) != 0
268
  while (!dp->d_ino || (substring (dirname, dp->d_name) != 0
281
			|| (print_possibilities && ch != '/')));
269
			|| (handle && ch != '/')));
282
270
283
  /* only get here if we have a matching directory entry */
271
  /* only get here if we have a matching directory entry */
284
272
(-)grub-0.96.dirs/stage2/fsys_iso9660.c (-6 / +4 lines)
Lines 133-139 Link Here
133
}
133
}
134
134
135
int
135
int
136
iso9660_dir (char *dirname)
136
iso9660_dir (char *dirname, void (*handle)(char *))
137
{
137
{
138
  struct iso_directory_record *idr;
138
  struct iso_directory_record *idr;
139
  RR_ptr_t rr_ptr;
139
  RR_ptr_t rr_ptr;
Lines 346-352 Link Here
346
	      if (name_len >= pathlen
346
	      if (name_len >= pathlen
347
		  && !memcmp(name, dirname, pathlen))
347
		  && !memcmp(name, dirname, pathlen))
348
		{
348
		{
349
		  if (dirname[pathlen] == '/' || !print_possibilities)
349
		  if (dirname[pathlen] == '/' || !handle)
350
		    {
350
		    {
351
		      /*
351
		      /*
352
		       *  DIRNAME is directory component of pathname,
352
		       *  DIRNAME is directory component of pathname,
Lines 377-387 Link Here
377
		  else	/* Completion */
377
		  else	/* Completion */
378
		    {
378
		    {
379
#ifndef STAGE1_5
379
#ifndef STAGE1_5
380
		      if (print_possibilities > 0)
381
			print_possibilities = -print_possibilities;
382
		      memcpy(NAME_BUF, name, name_len);
380
		      memcpy(NAME_BUF, name, name_len);
383
		      NAME_BUF[name_len] = '\0';
381
		      NAME_BUF[name_len] = '\0';
384
		      print_a_completion (NAME_BUF);
382
		      handle (NAME_BUF);
385
#endif
383
#endif
386
		    }
384
		    }
387
		}
385
		}
Lines 390-396 Link Here
390
	  size -= ISO_SECTOR_SIZE;
388
	  size -= ISO_SECTOR_SIZE;
391
	} /* size>0 */
389
	} /* size>0 */
392
390
393
      if (dirname[pathlen] == '/' || print_possibilities >= 0)
391
      if (dirname[pathlen] == '/' || handle)
394
	{
392
	{
395
	  errnum = ERR_FILE_NOT_FOUND;
393
	  errnum = ERR_FILE_NOT_FOUND;
396
	  return 0;
394
	  return 0;
(-)grub-0.96.dirs/stage2/fsys_jfs.c (-10 / +4 lines)
Lines 270-276 Link Here
270
}
270
}
271
271
272
int
272
int
273
jfs_dir (char *dirname)
273
jfs_dir (char *dirname, void (*handle)(char *))
274
{
274
{
275
	char *ptr, *rest, ch;
275
	char *ptr, *rest, ch;
276
	ldtentry_t *de;
276
	ldtentry_t *de;
Lines 357-368 Link Here
357
357
358
			cmp = (!*dirname) ? -1 : substring (dirname, namebuf);
358
			cmp = (!*dirname) ? -1 : substring (dirname, namebuf);
359
#ifndef STAGE1_5
359
#ifndef STAGE1_5
360
			if (print_possibilities && ch != '/'
360
			if (handle && ch != '/' && cmp <= 0)
361
			    && cmp <= 0) {
361
				handle (namebuf);
362
				if (print_possibilities > 0)
362
			else
363
					print_possibilities = -print_possibilities;
364
				print_a_completion (namebuf);
365
			} else
366
#endif
363
#endif
367
			if (cmp == 0) {
364
			if (cmp == 0) {
368
				parent_inum = inum;
365
				parent_inum = inum;
Lines 372-380 Link Here
372
			}
369
			}
373
			de = next_dentry ();
370
			de = next_dentry ();
374
			if (de == NULL) {
371
			if (de == NULL) {
375
				if (print_possibilities < 0)
376
					return 1;
377
378
				errnum = ERR_FILE_NOT_FOUND;
372
				errnum = ERR_FILE_NOT_FOUND;
379
				*rest = ch;
373
				*rest = ch;
380
				return 0;
374
				return 0;
(-)grub-0.96.dirs/stage2/fsys_minix.c (-21 / +7 lines)
Lines 294-300 Link Here
294
     inode of the file we were trying to look up
294
     inode of the file we were trying to look up
295
   side effects: none yet  */
295
   side effects: none yet  */
296
int
296
int
297
minix_dir (char *dirname)
297
minix_dir (char *dirname, void (*handle)(char *))
298
{
298
{
299
  int current_ino = MINIX_ROOT_INO;  /* start at the root */
299
  int current_ino = MINIX_ROOT_INO;  /* start at the root */
300
  int updir_ino = current_ino;	     /* the parent of the current directory */
300
  int updir_ino = current_ino;	     /* the parent of the current directory */
Lines 457-474 Link Here
457
	     give up */
457
	     give up */
458
	  if (loc >= INODE->i_size)
458
	  if (loc >= INODE->i_size)
459
	    {
459
	    {
460
	      if (print_possibilities < 0)
460
	      errnum = ERR_FILE_NOT_FOUND;
461
		{
461
	      *rest = ch;
462
#if 0
462
	      return 0;
463
		  putchar ('\n');
464
#endif
465
		}
466
	      else
467
		{
468
		  errnum = ERR_FILE_NOT_FOUND;
469
		  *rest = ch;
470
		}
471
	      return (print_possibilities < 0);
472
	    }
463
	    }
473
464
474
	  /* else, find the (logical) block component of our location */
465
	  /* else, find the (logical) block component of our location */
Lines 510-529 Link Here
510
	      str_chk = substring (dirname, dp->name);
501
	      str_chk = substring (dirname, dp->name);
511
502
512
# ifndef STAGE1_5
503
# ifndef STAGE1_5
513
	      if (print_possibilities && ch != '/'
504
	      if (handle && ch != '/' && (!*dirname || str_chk <= 0))
514
		  && (!*dirname || str_chk <= 0))
505
		handle (dp->name);
515
		{
516
		  if (print_possibilities > 0)
517
		    print_possibilities = -print_possibilities;
518
		  print_a_completion (dp->name);
519
		}
520
# endif
506
# endif
521
507
522
	      dp->name[namelen] = saved_c;
508
	      dp->name[namelen] = saved_c;
523
	    }
509
	    }
524
510
525
	}
511
	}
526
      while (!dp->inode || (str_chk || (print_possibilities && ch != '/')));
512
      while (!dp->inode || (str_chk || (handle && ch != '/')));
527
513
528
      current_ino = dp->inode;
514
      current_ino = dp->inode;
529
      *(dirname = rest) = ch;
515
      *(dirname = rest) = ch;
(-)grub-0.96.dirs/stage2/fsys_reiserfs.c (-11 / +3 lines)
Lines 991-997 Link Here
991
 *   the size of the file.
991
 *   the size of the file.
992
 */
992
 */
993
int
993
int
994
reiserfs_dir (char *dirname)
994
reiserfs_dir (char *dirname, void (*handle)(char *))
995
{
995
{
996
  struct reiserfs_de_head *de_head;
996
  struct reiserfs_de_head *de_head;
997
  char *rest, ch;
997
  char *rest, ch;
Lines 1123-1129 Link Here
1123
      *rest = 0;
1123
      *rest = 0;
1124
      
1124
      
1125
# ifndef STAGE1_5
1125
# ifndef STAGE1_5
1126
      if (print_possibilities && ch != '/')
1126
      if (handle && ch != '/')
1127
	do_possibilities = 1;
1127
	do_possibilities = 1;
1128
# endif /* ! STAGE1_5 */
1128
# endif /* ! STAGE1_5 */
1129
      
1129
      
Lines 1170-1179 Link Here
1170
		    {
1170
		    {
1171
		      if (cmp <= 0)
1171
		      if (cmp <= 0)
1172
			{
1172
			{
1173
			  if (print_possibilities > 0)
1174
			    print_possibilities = -print_possibilities;
1175
			  *name_end = 0;
1173
			  *name_end = 0;
1176
			  print_a_completion (filename);
1174
			  handle (filename);
1177
			  *name_end = tmp;
1175
			  *name_end = tmp;
1178
			}
1176
			}
1179
		    }
1177
		    }
Lines 1189-1200 Link Here
1189
	      num_entries--;
1187
	      num_entries--;
1190
	    }
1188
	    }
1191
	}
1189
	}
1192
      
1193
# ifndef STAGE1_5
1194
      if (print_possibilities < 0)
1195
	return 1;
1196
# endif /* ! STAGE1_5 */
1197
      
1198
      errnum = ERR_FILE_NOT_FOUND;
1190
      errnum = ERR_FILE_NOT_FOUND;
1199
      *rest = ch;
1191
      *rest = ch;
1200
      return 0;
1192
      return 0;
(-)grub-0.96.dirs/stage2/fsys_ufs2.c (-12 / +4 lines)
Lines 204-210 Link Here
204
}
204
}
205
205
206
int
206
int
207
ufs2_dir (char *dirname)
207
ufs2_dir (char *dirname, void (*handle)(char *))
208
{
208
{
209
  char *rest, ch;
209
  char *rest, ch;
210
  int block, off, loc, ino = ROOTINO;
210
  int block, off, loc, ino = ROOTINO;
Lines 261-269 Link Here
261
    {
261
    {
262
      if (loc >= INODE_UFS2->di_size)
262
      if (loc >= INODE_UFS2->di_size)
263
	{
263
	{
264
	  if (print_possibilities < 0)
265
	    return 1;
266
267
	  errnum = ERR_FILE_NOT_FOUND;
264
	  errnum = ERR_FILE_NOT_FOUND;
268
	  *rest = ch;
265
	  *rest = ch;
269
	  return 0;
266
	  return 0;
Lines 288-305 Link Here
288
      loc += dp->d_reclen;
285
      loc += dp->d_reclen;
289
286
290
#ifndef STAGE1_5
287
#ifndef STAGE1_5
291
      if (dp->d_ino && print_possibilities && ch != '/'
288
      if (dp->d_ino && handle && ch != '/'
292
	  && (!*dirname || substring (dirname, dp->d_name) <= 0))
289
	  && (!*dirname || substring (dirname, dp->d_name) <= 0))
293
	{
290
	handle (dp->d_name);
294
	  if (print_possibilities > 0)
295
	    print_possibilities = -print_possibilities;
296
297
	  print_a_completion (dp->d_name);
298
	}
299
#endif /* STAGE1_5 */
291
#endif /* STAGE1_5 */
300
    }
292
    }
301
  while (!dp->d_ino || (substring (dirname, dp->d_name) != 0
293
  while (!dp->d_ino || (substring (dirname, dp->d_name) != 0
302
			|| (print_possibilities && ch != '/')));
294
			|| (handle && ch != '/')));
303
295
304
  /* only get here if we have a matching directory entry */
296
  /* only get here if we have a matching directory entry */
305
297
(-)grub-0.96.dirs/stage2/fsys_vstafs.c (-14 / +3 lines)
Lines 115-121 Link Here
115
}
115
}
116
116
117
int 
117
int 
118
vstafs_dir (char *dirname)
118
vstafs_dir (char *dirname, void (*handle)(char *))
119
{
119
{
120
  char *fn, ch;
120
  char *fn, ch;
121
  struct dir_entry *d;
121
  struct dir_entry *d;
Lines 146-159 Link Here
146
	    continue;
146
	    continue;
147
	  
147
	  
148
#ifndef STAGE1_5
148
#ifndef STAGE1_5
149
	  if (print_possibilities && ch != '/'
149
	  if (handle && ch != '/'
150
	      && (! *dirname || strcmp (dirname, d->name) <= 0))
150
	      && (! *dirname || strcmp (dirname, d->name) <= 0))
151
	    {
151
	    handle(d->name);
152
	      if (print_possibilities > 0)
153
		print_possibilities = -print_possibilities;
154
	      
155
	      printf ("  %s", d->name);
156
	    }
157
#endif
152
#endif
158
	  if (! grub_strcmp (dirname, d->name))
153
	  if (! grub_strcmp (dirname, d->name))
159
	    {
154
	    {
Lines 168-179 Link Here
168
      *(dirname = fn) = ch;
163
      *(dirname = fn) = ch;
169
      if (! d)
164
      if (! d)
170
	{
165
	{
171
	  if (print_possibilities < 0)
172
	    {
173
	      putchar ('\n');
174
	      return 1;
175
	    }
176
	  
177
	  errnum = ERR_FILE_NOT_FOUND;
166
	  errnum = ERR_FILE_NOT_FOUND;
178
	  return 0;
167
	  return 0;
179
	}
168
	}
(-)grub-0.96.dirs/stage2/fsys_xfs.c (-9 / +4 lines)
Lines 534-540 Link Here
534
}
534
}
535
535
536
int
536
int
537
xfs_dir (char *dirname)
537
xfs_dir (char *dirname, void (*handle)(char *))
538
{
538
{
539
	xfs_ino_t ino, parent_ino, new_ino;
539
	xfs_ino_t ino, parent_ino, new_ino;
540
	xfs_fsize_t di_size;
540
	xfs_fsize_t di_size;
Lines 595-605 Link Here
595
		for (;;) {
595
		for (;;) {
596
			cmp = (!*dirname) ? -1 : substring (dirname, name);
596
			cmp = (!*dirname) ? -1 : substring (dirname, name);
597
#ifndef STAGE1_5
597
#ifndef STAGE1_5
598
			if (print_possibilities && ch != '/' && cmp <= 0) {
598
			if (handle && ch != '/' && cmp <= 0)
599
				if (print_possibilities > 0)
599
				handle (name);
600
					print_possibilities = -print_possibilities;
600
			else
601
				print_a_completion (name);
602
			} else
603
#endif
601
#endif
604
			if (cmp == 0) {
602
			if (cmp == 0) {
605
				parent_ino = ino;
603
				parent_ino = ino;
Lines 610-618 Link Here
610
			}
608
			}
611
			name = next_dentry (&new_ino);
609
			name = next_dentry (&new_ino);
612
			if (name == NULL) {
610
			if (name == NULL) {
613
				if (print_possibilities < 0)
614
					return 1;
615
616
				errnum = ERR_FILE_NOT_FOUND;
611
				errnum = ERR_FILE_NOT_FOUND;
617
				*rest = ch;
612
				*rest = ch;
618
				return 0;
613
				return 0;
(-)grub-0.96.dirs/stage2/shared.h (-3 / +5 lines)
Lines 1012-1020 Link Here
1012
/* Close a file.  */
1012
/* Close a file.  */
1013
void grub_close (void);
1013
void grub_close (void);
1014
1014
1015
/* List the contents of the directory that was opened with GRUB_OPEN,
1015
/* List the contents of DIRECTORY. */
1016
   printing all completions. */
1016
int dir (char *dirname, void (*handle)(char *));
1017
int dir (char *dirname);
1017
 
1018
/* Wildcard expand the last pathname component of GLOB. */
1019
char *wildcard (char *glob, int *len);
1018
1020
1019
int set_bootdev (int hdbias);
1021
int set_bootdev (int hdbias);
1020
1022
(-)grub-0.96.dirs/stage2/stage2.c (-5 / +287 lines)
Lines 1243-1248 Link Here
1243
}
1243
}
1244
1244
1245
1245
1246
char *wildcard_prefix, *wildcard_suffix;
1247
char wildcard_matches[1024], *end_wildcard_matches;
1248
1249
static void wildcard_handler(char *name);
1250
1251
/* Match one directory entry against the current wildcard. If the entry
1252
   matches, store it in WILDCARD_MATCHES. Silently ignore entries that
1253
   don't fit into WILDCARD_MATCHES anymore. */
1254
static void
1255
wildcard_handler(char *name)
1256
{
1257
  char *n = name, *p = wildcard_prefix;
1258
1259
  while (*p && *p == *n)
1260
    {
1261
      p++;
1262
      n++;
1263
    }
1264
  if (*p)
1265
    return; /* prefix mismatch */
1266
1267
  p = name + grub_strlen (name) - grub_strlen (wildcard_suffix);
1268
  /* [n .. p) is the part matching the asterisk */
1269
1270
  if (p < n || grub_strcmp (p, wildcard_suffix) != 0)
1271
    return; /* suffix mismatch */
1272
1273
  /* store this match */
1274
  if (p - n + 1 > sizeof (wildcard_matches) -
1275
		  (end_wildcard_matches - wildcard_matches))
1276
    return; /* out of space */
1277
  while (n < p)
1278
    *end_wildcard_matches++ = *n++;
1279
  *end_wildcard_matches++ = 0;
1280
}
1281
1282
/* Wildcard expand the GLOB argument. Return NULL upon failure, or
1283
   a list of 0-terminated expansions, terminated by a zero-length string. */
1284
char *
1285
wildcard (char *glob, int *len)
1286
{
1287
  char path[128], *p;
1288
  int ret;
1289
1290
  end_wildcard_matches = wildcard_matches;
1291
  if (grub_strlen (glob) + 1 > sizeof (path)) {
1292
    errnum = ERR_FILELENGTH;
1293
    return NULL;  /* cannot handle pathnames this long */
1294
  }
1295
  grub_strcpy (path, glob);
1296
  p = path;
1297
  while (*p)
1298
    p++;
1299
  wildcard_suffix = p;
1300
  while (p > path && *p != '/')
1301
    p--;
1302
  if (*p != '/')
1303
    {
1304
      errnum = ERR_BAD_FILETYPE;
1305
      return NULL; /* Cannot wildcard device names */
1306
    }
1307
  *(++p) = 0;
1308
  wildcard_prefix = glob + (p - path);
1309
  for (p = wildcard_prefix;; p++)
1310
    {
1311
      if (*p == 0)
1312
	{
1313
	  /* We cannot do exact matches: this cannot be represented in the
1314
	     result list. */
1315
	  return NULL;
1316
	}
1317
      else if (*p == '*')
1318
	{
1319
	  *p++ = 0;
1320
	  wildcard_suffix = p;
1321
	  break;
1322
	}
1323
    }
1324
1325
  ret = dir (path, wildcard_handler);
1326
  /* restore original argument */
1327
  wildcard_prefix[grub_strlen (wildcard_prefix)] = '*';
1328
  if (!ret)
1329
    return NULL;
1330
  *len = end_wildcard_matches - wildcard_matches;
1331
  return wildcard_matches;
1332
}
1333
1334
#define skip(str) ((str) + grub_strlen (str) + 1)
1335
1336
static void inplace_sort (char *str, int len);
1337
1338
static void
1339
inplace_sort (char *str, int len)
1340
{
1341
  int m, n = 0;
1342
  char *s, *t;
1343
1344
  /* we use x as temporary storage */
1345
  char *x = str + len;
1346
1347
  for (s = str; s < x; s = skip (s))
1348
    n++;
1349
1350
  for (; n >= 2; n--)
1351
    {
1352
      s = str;
1353
      t = skip (s);
1354
1355
      for (m = n; m >= 2; m--)
1356
	{
1357
	  if (grub_strcmp (s, t) > 0)
1358
	    {
1359
	      int ls = skip (s) - s;
1360
	      int lt = skip (t) - t;
1361
1362
	      memcpy (x, s, ls);
1363
	      grub_memmove (s + ls, s + lt, t - (s + ls));
1364
	      memcpy (s, t, lt);
1365
	      t = t + lt - ls;
1366
	      memcpy (t, x, ls);
1367
	    }
1368
	  s = t;
1369
	  t = skip (t);
1370
	}
1371
    }
1372
}
1373
1374
#undef skip
1375
1376
static int this_config_len (const char *config);
1377
static int
1378
this_config_len (const char *config)
1379
{
1380
  const char *c = config;
1381
  while (*c)
1382
    {
1383
      while (*c)
1384
	c++;
1385
      c++;
1386
    }
1387
  c++;
1388
  return c - config;
1389
}
1390
1391
static const char * expand_asterisks (const char *str, int *len,
1392
				      const char *subst);
1393
1394
/* Expand all asterisks (*) in a menu entry or commands section with its
1395
   substitution. Use a backslash as escape character. */
1396
static const char *
1397
expand_asterisks (const char *str, int *len, const char *subst)
1398
{
1399
  static char buffer[1024];
1400
  char *b = buffer, escaped = 0;
1401
  const char *end = str + *len;
1402
1403
  while (str < end)
1404
    {
1405
      if (*str == '*' && !escaped)
1406
        {
1407
	  if (b - buffer + grub_strlen (subst) > sizeof (buffer))
1408
	    {
1409
	      errnum = ERR_FILELENGTH;
1410
	      return NULL;
1411
	    }
1412
	  grub_strcpy (b, subst);
1413
	  b += grub_strlen (subst);
1414
	}
1415
      else if (*str == '\\' && !escaped)
1416
	escaped = 1;
1417
      else
1418
        {
1419
	  escaped = 0;
1420
	  if (b - buffer + 1 > sizeof (buffer))
1421
	    {
1422
	      errnum = ERR_FILELENGTH;
1423
	      return NULL;
1424
	    }
1425
	  *b++ = *str;
1426
	}
1427
      str++;
1428
    }
1429
    *len = b - buffer;
1430
1431
    return buffer;
1432
}
1433
1246
/* This is the starting function in C.  */
1434
/* This is the starting function in C.  */
1247
void
1435
void
1248
cmain (void)
1436
cmain (void)
Lines 1262-1267 Link Here
1262
      menu_entries = (char *) MENU_BUF;
1450
      menu_entries = (char *) MENU_BUF;
1263
      init_config ();
1451
      init_config ();
1264
    }
1452
    }
1453
1454
  auto void expand_wildcard_entries (void);
1455
  void expand_wildcard_entries (void)
1456
    {
1457
      char *config_entry = config_entries;
1458
      char *menu_entry = menu_entries;
1459
1460
      while (*menu_entry)
1461
        {
1462
	  char *command = config_entry;
1463
1464
	  do
1465
	    {
1466
	      char *c = command;
1467
	      const char *w = "wildcard";
1468
1469
	      while (*w && *c == *w)
1470
		{
1471
		  c++;
1472
		  w++;
1473
		}
1474
	      if (*w == 0 && (*c == ' ' || *c == '\t' || *c == '='))
1475
		{
1476
		  int len, wlen;
1477
1478
		  /* This is a wildcard command. Advance to the argument. */
1479
		  while (*c == ' ' || *c == '\t' || *c == '=')
1480
		    c++;
1481
1482
		  /* Expand wildcard entry. */
1483
		  w = wildcard (c, &wlen);
1484
		  if (w)
1485
		    inplace_sort (w, wlen);
1486
1487
		  /* Remove the wildcard command from the command section;
1488
		     it has no meaning beyond the wildcard expansion just
1489
		     performed. */
1490
		  len = grub_strlen (command) + 1;
1491
		  grub_memmove (command, command + len,
1492
		  		config_len - (command - config_entries));
1493
		  config_len -= len;
1494
1495
		  while (w && wlen)
1496
		    {
1497
		      /* Insert expansion before the wildcard entry in the
1498
		         list of entry names. */
1499
		      len = grub_strlen (menu_entry) + 1;
1500
		      const char *x = expand_asterisks (menu_entry, &len, w);
1501
		      grub_memmove (menu_entry + len, menu_entry,
1502
		      		    menu_len - (menu_entry - menu_entries));
1503
		      memcpy (menu_entry, x, len);
1504
		      menu_entry += len;
1505
		      menu_len += len;
1506
		      
1507
		      /* Insert expansion before the wildcard command section
1508
		         in the list of command sections. */
1509
		      len = this_config_len (config_entry);
1510
		      x = expand_asterisks (config_entry, &len, w);
1511
		      grub_memmove (config_entry + len, config_entry,
1512
		      		    config_len - (config_entry -
1513
				    		  config_entries));
1514
		      memcpy (config_entry, x, len);
1515
		      config_entry += len;
1516
		      config_len += len;
1517
1518
		      num_entries++;
1519
		      wlen -= grub_strlen (w) + 1;
1520
		      w += grub_strlen (w) + 1;
1521
		    }
1522
1523
		  /* Remove the wildcard command section; it has just
1524
		     been expanded. */
1525
		  len = grub_strlen (menu_entry) + 1;
1526
		  grub_memmove (menu_entry, menu_entry + len,
1527
		  		menu_len - (menu_entry - menu_entries));
1528
		  menu_len -= len;
1529
1530
		  len = this_config_len(config_entry);
1531
		  grub_memmove (config_entry, config_entry + len,
1532
		  		config_len - (config_entry - config_entries));
1533
		  config_len -= len;
1534
1535
		  num_entries--;
1536
		}
1537
	      command += grub_strlen (command) + 1;
1538
	    }
1539
	  while (*command);
1540
	  menu_entry += grub_strlen (menu_entry) + 1;
1541
	  config_entry += this_config_len(config_entry);
1542
	}
1543
    }
1265
  
1544
  
1266
  /* Initialize the environment for restarting Stage 2.  */
1545
  /* Initialize the environment for restarting Stage 2.  */
1267
  grub_setjmp (restart_env);
1546
  grub_setjmp (restart_env);
Lines 1413-1420 Link Here
1413
		  config_len = prev_config_len;
1692
		  config_len = prev_config_len;
1414
		}
1693
		}
1415
	      
1694
	      
1695
	      if (is_preset)
1696
		close_preset_menu ();
1697
	      else
1698
		grub_close ();
1699
	      
1416
	      menu_entries[menu_len++] = 0;
1700
	      menu_entries[menu_len++] = 0;
1417
	      config_entries[config_len++] = 0;
1701
	      config_entries[config_len++] = 0;
1702
1703
	      expand_wildcard_entries();
1704
1418
	      grub_memmove (config_entries + config_len, menu_entries,
1705
	      grub_memmove (config_entries + config_len, menu_entries,
1419
			    menu_len);
1706
			    menu_len);
1420
	      menu_entries = config_entries + config_len;
1707
	      menu_entries = config_entries + config_len;
Lines 1455-1465 Link Here
1455
		  else
1742
		  else
1456
		    default_entry = 0;
1743
		    default_entry = 0;
1457
		}
1744
		}
1458
	      
1459
	      if (is_preset)
1460
		close_preset_menu ();
1461
	      else
1462
		grub_close ();
1463
	    }
1745
	    }
1464
	  while (is_preset);
1746
	  while (is_preset);
1465
	}
1747
	}

Return to bug 85779