Changeset View
Changeset View
Standalone View
Standalone View
head/bin/sh/eval.c
Show First 20 Lines • Show All 794 Lines • ▼ Show 20 Lines | |||||
* even though it should be in a subshell (command substitution). | * even though it should be in a subshell (command substitution). | ||||
* Note that jobid, jobs, times and trap can show information not | * Note that jobid, jobs, times and trap can show information not | ||||
* available in a child process; this is deliberate. | * available in a child process; this is deliberate. | ||||
* The arguments should already have been expanded. | * The arguments should already have been expanded. | ||||
*/ | */ | ||||
static int | static int | ||||
safe_builtin(int idx, int argc, char **argv) | safe_builtin(int idx, int argc, char **argv) | ||||
{ | { | ||||
if (idx == BLTINCMD || idx == COMMANDCMD || idx == ECHOCMD || | /* Generated from builtins.def. */ | ||||
idx == FALSECMD || idx == JOBIDCMD || idx == JOBSCMD || | if (safe_builtin_always(idx)) | ||||
idx == KILLCMD || idx == PRINTFCMD || idx == PWDCMD || | |||||
idx == TESTCMD || idx == TIMESCMD || idx == TRUECMD || | |||||
idx == TYPECMD) | |||||
return (1); | return (1); | ||||
if (idx == EXPORTCMD || idx == TRAPCMD || idx == ULIMITCMD || | if (idx == EXPORTCMD || idx == TRAPCMD || idx == ULIMITCMD || | ||||
idx == UMASKCMD) | idx == UMASKCMD) | ||||
return (argc <= 1 || (argc == 2 && argv[1][0] == '-')); | return (argc <= 1 || (argc == 2 && argv[1][0] == '-')); | ||||
if (idx == SETCMD) | if (idx == SETCMD) | ||||
return (argc <= 1 || (argc == 2 && (argv[1][0] == '-' || | return (argc <= 1 || (argc == 2 && (argv[1][0] == '-' || | ||||
argv[1][0] == '+') && argv[1][1] == 'o' && | argv[1][0] == '+') && argv[1][1] == 'o' && | ||||
argv[1][2] == '\0')); | argv[1][2] == '\0')); | ||||
▲ Show 20 Lines • Show All 570 Lines • Show Last 20 Lines |