2005-10-24 Marco Gerards <mgerards@xs4all.nl>

* include/grub/parser.h: New file.

	* kern/parser.c: Likewise.

	* conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/parser.c'.
	(grub_setup_SOURCES): Likewise.
	(grub_probefs_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.
	(kernel_img_HEADERS): Add `parser.h'.

	* conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
	(grub_emu_SOURCES): Add `kern/parser.c'.
	(grubof_SOURCES): Likewise.

	* conf/sparc64-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
	(grubof_SOURCES): Add `kern/parser.c'.

	* include/grub/misc.h (grub_split_cmdline): Removed prototype.

	* kern/misc.c (grub_split_cmdline): Removed function.

	* kern/rescue.c: Include <grub/parser.h>.
	(grub_enter_rescue_mode): Use `grub_parser_split_cmdline' instead
	of `grub_split_cmdline'.

	* normal/command.c: Include <grub/parser.h>.
	(grub_command_execute):  Use `grub_parser_split_cmdline' instead
	of `grub_split_cmdline'.

	* normal/completion.c: Include <grub/parser.h>.
	(cmdline_state): New variable.
	(iterate_dir): End the filename with a quote depending on the
	command line state.
	(get_state): new function.
	(grub_normal_do_completion): Use `grub_parser_split_cmdline' to
	split the arguments and determine the current argument.  When the
	argument string is not quoted, escape all spaces.
This commit is contained in:
marco_g 2005-10-24 10:23:46 +00:00
parent 6d8f4b0e60
commit 04ccf3ec6f
14 changed files with 531 additions and 324 deletions

View file

@ -1,7 +1,7 @@
/* rescue.c - rescue mode */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,6 +30,7 @@
#include <grub/dl.h>
#include <grub/partition.h>
#include <grub/env.h>
#include <grub/parser.h>
#define GRUB_RESCUE_BUF_SIZE 256
#define GRUB_RESCUE_MAX_ARGS 20
@ -650,7 +651,7 @@ grub_enter_rescue_mode (void)
/* Get a command line. */
grub_rescue_get_command_line ("grub rescue> ");
if (grub_split_cmdline (line, getline, &n, &args) || n < 0)
if (grub_parser_split_cmdline (line, getline, &n, &args) || n < 0)
continue;
/* In case of an assignment set the environment accordingly