+2000-10-14 OKUJI Yoshinori <okuji@gnu.org>
+
+ * stage2/builtins.c (setkey_func): If TO_KEY is NULL (i.e. the
+ user specifies no argument), clear BIOS_KEY_MAP and
+ ASCII_KEY_MAP.
+ If TO_KEY is non-NULL but FROM_KEY is NULL, set ERRNUM to
+ ERR_BAD_ARGUMENT and return one.
+
2000-10-13 OKUJI Yoshinori <okuji@gnu.org>
* docs/grub.texi: Added an entry for the new chapter "Security",
to_key = arg;
from_key = skip_to (0, to_key);
+
+ if (! to_key)
+ {
+ /* If the user specifies no argument, reset the key mappings. */
+ bios_key_map[0] = 0;
+ ascii_key_map[0] = 0;
+
+ return 0;
+ }
+ else if (! from_key)
+ {
+ /* The user must specify two arguments or zero argument. */
+ errnum = ERR_BAD_ARGUMENT;
+ return 1;
+ }
nul_terminate (to_key);
nul_terminate (from_key);
"setkey",
setkey_func,
BUILTIN_CMDLINE | BUILTIN_MENU,
- "setkey TO_KEY FROM_KEY",
+ "setkey [TO_KEY FROM_KEY]",
"Change the keyboard map. The key FROM_KEY is mapped to the key TO_KEY."
" A key must be an alphabet, a digit, or one of these: escape, exclam,"
" at, numbersign, dollar, percent, caret, ampersand, asterisk, parenleft,"
" braceleft, bracketright, braceright, enter, control, semicolon, colon,"
" quote, doublequote, backquote, tilde, shift, backslash, bar, comma,"
" less, period, greater, slash, question, alt, space, capslock, FX (X"
- " is a digit), and delete."
+ " is a digit), and delete. If no argument is specified, reset key"
+ " mappings."
};
\f