aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-28 01:57:05 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-28 01:57:05 +0100
commit17323a6245597f16321e6bf99536ae9bb89c79cf (patch)
tree54036f105be16bc2244ec7ada5e1e834378824f5 /shell/hush.c
parent2755f4e4439fa4c959ea5c4d679de77b8cd7a943 (diff)
downloadbusybox-w32-17323a6245597f16321e6bf99536ae9bb89c79cf.tar.gz
busybox-w32-17323a6245597f16321e6bf99536ae9bb89c79cf.tar.bz2
busybox-w32-17323a6245597f16321e6bf99536ae9bb89c79cf.zip
hush: more "greppable" field names. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/shell/hush.c b/shell/hush.c
index e0c562621..0a25967a1 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -621,10 +621,10 @@ static int builtin_return(char **argv) FAST_FUNC;
621 * For example, 'unset foo | whatever' will parse and run, but foo will 621 * For example, 'unset foo | whatever' will parse and run, but foo will
622 * still be set at the end. */ 622 * still be set at the end. */
623struct built_in_command { 623struct built_in_command {
624 const char *cmd; 624 const char *b_cmd;
625 int (*function)(char **argv) FAST_FUNC; 625 int (*b_function)(char **argv) FAST_FUNC;
626#if ENABLE_HUSH_HELP 626#if ENABLE_HUSH_HELP
627 const char *descr; 627 const char *b_descr;
628# define BLTIN(cmd, func, help) { cmd, func, help } 628# define BLTIN(cmd, func, help) { cmd, func, help }
629#else 629#else
630# define BLTIN(cmd, func, help) { cmd, func } 630# define BLTIN(cmd, func, help) { cmd, func }
@@ -3336,7 +3336,7 @@ static const struct built_in_command* find_builtin_helper(const char *name,
3336 const struct built_in_command *end) 3336 const struct built_in_command *end)
3337{ 3337{
3338 while (x != end) { 3338 while (x != end) {
3339 if (strcmp(name, x->cmd) != 0) { 3339 if (strcmp(name, x->b_cmd) != 0) {
3340 x++; 3340 x++;
3341 continue; 3341 continue;
3342 } 3342 }
@@ -3547,7 +3547,7 @@ static void exec_builtin(char ***to_free,
3547 char **argv) 3547 char **argv)
3548{ 3548{
3549#if BB_MMU 3549#if BB_MMU
3550 int rcode = x->function(argv); 3550 int rcode = x->b_function(argv);
3551 fflush_all(); 3551 fflush_all();
3552 _exit(rcode); 3552 _exit(rcode);
3553#else 3553#else
@@ -4159,7 +4159,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
4159#endif 4159#endif
4160 if (x || funcp) { 4160 if (x || funcp) {
4161 if (!funcp) { 4161 if (!funcp) {
4162 if (x->function == builtin_exec && argv_expanded[1] == NULL) { 4162 if (x->b_function == builtin_exec && argv_expanded[1] == NULL) {
4163 debug_printf("exec with redirects only\n"); 4163 debug_printf("exec with redirects only\n");
4164 rcode = setup_redirects(command, NULL); 4164 rcode = setup_redirects(command, NULL);
4165 goto clean_up_and_ret1; 4165 goto clean_up_and_ret1;
@@ -4176,7 +4176,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
4176 if (!funcp) { 4176 if (!funcp) {
4177 debug_printf_exec(": builtin '%s' '%s'...\n", 4177 debug_printf_exec(": builtin '%s' '%s'...\n",
4178 x->cmd, argv_expanded[1]); 4178 x->cmd, argv_expanded[1]);
4179 rcode = x->function(argv_expanded) & 0xff; 4179 rcode = x->b_function(argv_expanded) & 0xff;
4180 fflush_all(); 4180 fflush_all();
4181 } 4181 }
4182#if ENABLE_HUSH_FUNCTIONS 4182#if ENABLE_HUSH_FUNCTIONS
@@ -6908,11 +6908,11 @@ int hush_main(int argc, char **argv)
6908 * sh ... -c 'script' 6908 * sh ... -c 'script'
6909 * sh ... -c 'script' ARG0 [ARG1...] 6909 * sh ... -c 'script' ARG0 [ARG1...]
6910 * On NOMMU, if builtin_argc != 0, 6910 * On NOMMU, if builtin_argc != 0,
6911 * sh ... -c 'builtin' [BARGV...] "" ARG0 [ARG1...] 6911 * sh ... -c 'builtin' BARGV... "" ARG0 [ARG1...]
6912 * "" needs to be replaced with NULL 6912 * "" needs to be replaced with NULL
6913 * and BARGV vector fed to builtin function. 6913 * and BARGV vector fed to builtin function.
6914 * Note: this form never happens: 6914 * Note: the form without ARG0 never happens:
6915 * sh ... -c 'builtin' [BARGV...] "" 6915 * sh ... -c 'builtin' BARGV... ""
6916 */ 6916 */
6917 if (!G.root_pid) { 6917 if (!G.root_pid) {
6918 G.root_pid = getpid(); 6918 G.root_pid = getpid();
@@ -6930,7 +6930,7 @@ int hush_main(int argc, char **argv)
6930 G.global_argc -= builtin_argc; /* skip [BARGV...] "" */ 6930 G.global_argc -= builtin_argc; /* skip [BARGV...] "" */
6931 G.global_argv += builtin_argc; 6931 G.global_argv += builtin_argc;
6932 G.global_argv[-1] = NULL; /* replace "" */ 6932 G.global_argv[-1] = NULL; /* replace "" */
6933 G.last_exitcode = x->function(argv + optind - 1); 6933 G.last_exitcode = x->b_function(argv + optind - 1);
6934 } 6934 }
6935 goto final_return; 6935 goto final_return;
6936 } 6936 }
@@ -7651,8 +7651,8 @@ static int FAST_FUNC builtin_help(char **argv UNUSED_PARAM)
7651 "Built-in commands:\n" 7651 "Built-in commands:\n"
7652 "------------------\n"); 7652 "------------------\n");
7653 for (x = bltins1; x != &bltins1[ARRAY_SIZE(bltins1)]; x++) { 7653 for (x = bltins1; x != &bltins1[ARRAY_SIZE(bltins1)]; x++) {
7654 if (x->descr) 7654 if (x->b_descr)
7655 printf("%s\t%s\n", x->cmd, x->descr); 7655 printf("%s\t%s\n", x->b_cmd, x->b_descr);
7656 } 7656 }
7657 bb_putchar('\n'); 7657 bb_putchar('\n');
7658 return EXIT_SUCCESS; 7658 return EXIT_SUCCESS;