diff options
author | Mark Whitley <markw@lineo.com> | 2000-07-12 23:36:17 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2000-07-12 23:36:17 +0000 |
commit | 37653aaf9c6ca3f21165e247ad385fb81d1b0112 (patch) | |
tree | 1a30b45c91726efbf5884accdba2caf01438c99d /shell/lash.c | |
parent | c41e8c840fd6faf802628036c7e5b2683d623c5d (diff) | |
download | busybox-w32-37653aaf9c6ca3f21165e247ad385fb81d1b0112.tar.gz busybox-w32-37653aaf9c6ca3f21165e247ad385fb81d1b0112.tar.bz2 busybox-w32-37653aaf9c6ca3f21165e247ad385fb81d1b0112.zip |
Added some smallish comments to help folks understand why we have two tables
of builtins and the reasoning behind it.
Diffstat (limited to 'shell/lash.c')
-rw-r--r-- | shell/lash.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/shell/lash.c b/shell/lash.c index 4620ae3ce..bb258c788 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -112,7 +112,9 @@ static int runCommand(struct job newJob, struct jobSet *jobList, int inBg); | |||
112 | static int busy_loop(FILE * input); | 112 | static int busy_loop(FILE * input); |
113 | 113 | ||
114 | 114 | ||
115 | /* Table of built-in functions */ | 115 | /* Table of built-in functions (these are non-forking builtins, meaning they |
116 | * can change global variables in the parent shell process but they will not | ||
117 | * work with pipes and redirects; 'unset foo | whatever' will not work) */ | ||
116 | static struct builtInCommand bltins[] = { | 118 | static struct builtInCommand bltins[] = { |
117 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, | 119 | {"bg", "Resume a job in the background", "bg [%%job]", builtin_fg_bg}, |
118 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, | 120 | {"cd", "Change working directory", "cd [dir]", builtin_cd}, |
@@ -125,7 +127,8 @@ static struct builtInCommand bltins[] = { | |||
125 | {NULL, NULL, NULL, NULL} | 127 | {NULL, NULL, NULL, NULL} |
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* Table of built-in functions */ | 130 | /* Table of forking built-in functions (things that fork cannot change global |
131 | * variables in the parent process, such as the current working directory) */ | ||
129 | static struct builtInCommand bltins_forking[] = { | 132 | static struct builtInCommand bltins_forking[] = { |
130 | {"env", "Print all environment variables", "env", builtin_env}, | 133 | {"env", "Print all environment variables", "env", builtin_env}, |
131 | {"pwd", "Print current directory", "pwd", builtin_pwd}, | 134 | {"pwd", "Print current directory", "pwd", builtin_pwd}, |