* job.c: Add "command" as a known shell built-in.

This is not a POSIX shell built-in but it's common in UNIX shells.
Reported by Nick Bowler <nbowler@draconx.ca>.
This commit is contained in:
Paul Smith 2017-11-12 18:10:28 -05:00
parent b80837c553
commit 1af314465e

16
job.c
View file

@ -2550,7 +2550,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
{ "cd", "echo", "eval", "exec", "exit", "login", "logout", "set", "umask", { "cd", "echo", "eval", "exec", "exit", "login", "logout", "set", "umask",
"wait", "while", "for", "case", "if", ":", ".", "break", "continue", "wait", "while", "for", "case", "if", ":", ".", "break", "continue",
"export", "read", "readonly", "shift", "times", "trap", "switch", "export", "read", "readonly", "shift", "times", "trap", "switch",
"unset", "ulimit", 0 }; "unset", "ulimit", "command", 0 };
const char *sh_chars; const char *sh_chars;
const char **sh_cmds; const char **sh_cmds;
@ -2577,7 +2577,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
{ "echo", "cd", "eval", "exec", "exit", "login", "logout", "set", "umask", { "echo", "cd", "eval", "exec", "exit", "login", "logout", "set", "umask",
"wait", "while", "for", "case", "if", ":", ".", "break", "continue", "wait", "while", "for", "case", "if", ":", ".", "break", "continue",
"export", "read", "readonly", "shift", "times", "trap", "switch", "export", "read", "readonly", "shift", "times", "trap", "switch",
"unset", 0 }; "unset", "command", 0 };
const char *sh_chars; const char *sh_chars;
const char **sh_cmds; const char **sh_cmds;
@ -2587,7 +2587,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
static const char *sh_cmds[] = static const char *sh_cmds[] =
{ "cd", "eval", "if", "delete", "echo", "copy", "rename", "set", "setenv", { "cd", "eval", "if", "delete", "echo", "copy", "rename", "set", "setenv",
"date", "makedir", "skip", "else", "endif", "path", "prompt", "unset", "date", "makedir", "skip", "else", "endif", "path", "prompt", "unset",
"unsetenv", "version", 0 }; "unsetenv", "version", "command", 0 };
#elif defined (WINDOWS32) #elif defined (WINDOWS32)
/* We used to have a double quote (") in sh_chars_dos[] below, but /* We used to have a double quote (") in sh_chars_dos[] below, but
@ -2610,7 +2610,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
static const char *sh_cmds_sh[] = static const char *sh_cmds_sh[] =
{ "cd", "eval", "exec", "exit", "login", "logout", "set", "umask", "wait", { "cd", "eval", "exec", "exit", "login", "logout", "set", "umask", "wait",
"while", "for", "case", "if", ":", ".", "break", "continue", "export", "while", "for", "case", "if", ":", ".", "break", "continue", "export",
"read", "readonly", "shift", "times", "trap", "switch", "test", "read", "readonly", "shift", "times", "trap", "switch", "test", "command",
#ifdef BATCH_MODE_ONLY_SHELL #ifdef BATCH_MODE_ONLY_SHELL
"echo", "echo",
#endif #endif
@ -2624,10 +2624,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
#else /* must be UNIX-ish */ #else /* must be UNIX-ish */
static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!"; static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!";
static const char *sh_cmds[] = static const char *sh_cmds[] =
{ ".", ":", "break", "case", "cd", "continue", "eval", "exec", "exit", { ".", ":", "break", "case", "cd", "command", "continue", "eval", "exec",
"export", "for", "if", "login", "logout", "read", "readonly", "set", "exit", "export", "for", "if", "login", "logout", "read", "readonly",
"shift", "switch", "test", "times", "trap", "ulimit", "umask", "unset", "set", "shift", "switch", "test", "times", "trap", "ulimit", "umask",
"wait", "while", 0 }; "unset", "wait", "while", 0 };
# ifdef HAVE_DOS_PATHS # ifdef HAVE_DOS_PATHS
/* This is required if the MSYS/Cygwin ports (which do not define /* This is required if the MSYS/Cygwin ports (which do not define