/* rescue_reader.c - rescue mode reader */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009,2010 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
/* Prompt to input a command and read the line. */
static grub_err_t
{
int c;
int pos = 0;
{
if (grub_isprint (c))
{
{
str[0] = c;
str[1] = 0;
grub_xputs (str);
}
}
else if (c == '\b')
{
if (pos > 0)
{
str[0] = c;
str[2] = c;
str[3] = 0;
grub_xputs (str);
}
}
grub_refresh ();
}
grub_xputs ("\n");
grub_refresh ();
return 0;
}
void __attribute__ ((noreturn))
grub_rescue_run (void)
{
grub_printf ("Entering rescue mode...\n");
while (1)
{
char *line;
/* Print an error, if any. */
grub_print_error ();
grub_rescue_read_line (&line, 0);
continue;
}
}