mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 14:59:34 +00:00
Fixes from Okuji
This commit is contained in:
1 parent
eea6c34440
commit
4cf606a18e
3 files changed
+24
No files matched your search
@@ -1,3 +1,13 @@
|
||||
1999-03-25 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||
|
||||
* char_io.c (get_cmdline): Call cl_setcpos even if lpos == llen,
|
||||
because ncurses won't update the cursor position.
|
||||
|
||||
* grub/main.c (OPT_HOLD): New macro.
|
||||
(longopts): New option --hold.
|
||||
(usage): Add the documentation about --hold.
|
||||
(main): Set hold if --hold is specified. Wait until cleared.
|
||||
|
||||
1999-03-22 Gordon Matzigkeit <gord@trick.fig.org>
|
||||
|
||||
* shared_src/cmdline.c (enter_cmdline): Check the return value of
|
||||
|
||||
+13
@@ -23,17 +23,20 @@ int grub_stage2 (void);
|
||||
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
|
||||
char *program_name = 0;
|
||||
|
||||
#define OPT_HELP -2
|
||||
#define OPT_VERSION -3
|
||||
#define OPT_HOLD -4
|
||||
#define OPTSTRING ""
|
||||
|
||||
static struct option longopts[] =
|
||||
{
|
||||
{"help", no_argument, 0, OPT_HELP},
|
||||
{"version", no_argument, 0, OPT_VERSION},
|
||||
{"hold", no_argument, 0, OPT_HOLD},
|
||||
{0},
|
||||
};
|
||||
|
||||
@@ -51,6 +54,7 @@ Usage: %s [OPTION]...\n\
|
||||
Enter the GRand Unified Bootloader command shell.\n\
|
||||
\n\
|
||||
--help display this message and exit\n\
|
||||
--hold wait forever so that a debugger may be attached\n\
|
||||
--version print version information and exit\n\
|
||||
",
|
||||
program_name);
|
||||
@@ -63,6 +67,7 @@ int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int hold = 0;
|
||||
program_name = argv[0];
|
||||
|
||||
/* Parse command-line options. */
|
||||
@@ -75,6 +80,10 @@ main (int argc, char **argv)
|
||||
/* Fall through the bottom of the loop. */
|
||||
break;
|
||||
|
||||
case OPT_HOLD:
|
||||
hold = 1;
|
||||
break;
|
||||
|
||||
case OPT_HELP:
|
||||
usage (0);
|
||||
break;
|
||||
@@ -90,6 +99,10 @@ main (int argc, char **argv)
|
||||
}
|
||||
while (c != EOF);
|
||||
|
||||
/* Wait until the HOLD variable is cleared by an attached debugger. */
|
||||
while (hold)
|
||||
sleep (1);
|
||||
|
||||
/* Transfer control to the stage2 simulator. */
|
||||
exit (grub_stage2 ());
|
||||
}
|
||||
@@ -362,6 +362,7 @@ get_cmdline (char *prompt, char *commands, char *cmdline, int maxlen)
|
||||
cmdline[lpos + 1] = 0;
|
||||
cl_print (cmdline + lpos);
|
||||
lpos ++;
|
||||
cl_setcpos ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user