diff options
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/shell/hush.c b/shell/hush.c index c61607dd3..2d5697269 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -536,11 +536,13 @@ static int done_pipe(struct p_context *ctx, pipe_style type); | |||
536 | static int redirect_dup_num(struct in_str *input); | 536 | static int redirect_dup_num(struct in_str *input); |
537 | static int redirect_opt_num(o_string *o); | 537 | static int redirect_opt_num(o_string *o); |
538 | #if ENABLE_HUSH_TICK | 538 | #if ENABLE_HUSH_TICK |
539 | static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, const char *subst_end); | 539 | static int process_command_subs(o_string *dest, /*struct p_context *ctx,*/ |
540 | struct in_str *input, const char *subst_end); | ||
540 | #endif | 541 | #endif |
541 | static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch); | 542 | static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch); |
542 | static const char *lookup_param(const char *src); | 543 | static const char *lookup_param(const char *src); |
543 | static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input); | 544 | static int handle_dollar(o_string *dest, /*struct p_context *ctx,*/ |
545 | struct in_str *input); | ||
544 | static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, const char *end_trigger); | 546 | static int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, const char *end_trigger); |
545 | /* setup: */ | 547 | /* setup: */ |
546 | static int parse_and_run_stream(struct in_str *inp, int parse_flag); | 548 | static int parse_and_run_stream(struct in_str *inp, int parse_flag); |
@@ -741,14 +743,14 @@ static void set_every_sighandler(void (*handler)(int)) | |||
741 | signal(SIGCHLD, handler); | 743 | signal(SIGCHLD, handler); |
742 | } | 744 | } |
743 | 745 | ||
744 | static void handler_ctrl_c(int sig) | 746 | static void handler_ctrl_c(int sig ATTRIBUTE_UNUSED) |
745 | { | 747 | { |
746 | debug_printf_jobs("got sig %d\n", sig); | 748 | debug_printf_jobs("got sig %d\n", sig); |
747 | // as usual we can have all kinds of nasty problems with leaked malloc data here | 749 | // as usual we can have all kinds of nasty problems with leaked malloc data here |
748 | siglongjmp(toplevel_jb, 1); | 750 | siglongjmp(toplevel_jb, 1); |
749 | } | 751 | } |
750 | 752 | ||
751 | static void handler_ctrl_z(int sig) | 753 | static void handler_ctrl_z(int sig ATTRIBUTE_UNUSED) |
752 | { | 754 | { |
753 | pid_t pid; | 755 | pid_t pid; |
754 | 756 | ||
@@ -3257,8 +3259,10 @@ static FILE *generate_stream_from_list(struct pipe *head) | |||
3257 | } | 3259 | } |
3258 | 3260 | ||
3259 | /* Return code is exit status of the process that is run. */ | 3261 | /* Return code is exit status of the process that is run. */ |
3260 | static int process_command_subs(o_string *dest, struct p_context *ctx, | 3262 | static int process_command_subs(o_string *dest, |
3261 | struct in_str *input, const char *subst_end) | 3263 | /*struct p_context *ctx,*/ |
3264 | struct in_str *input, | ||
3265 | const char *subst_end) | ||
3262 | { | 3266 | { |
3263 | int retcode, ch, eol_cnt; | 3267 | int retcode, ch, eol_cnt; |
3264 | o_string result = NULL_O_STRING; | 3268 | o_string result = NULL_O_STRING; |
@@ -3351,7 +3355,7 @@ static const char *lookup_param(const char *src) | |||
3351 | } | 3355 | } |
3352 | 3356 | ||
3353 | /* return code: 0 for OK, 1 for syntax error */ | 3357 | /* return code: 0 for OK, 1 for syntax error */ |
3354 | static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input) | 3358 | static int handle_dollar(o_string *dest, /*struct p_context *ctx,*/ struct in_str *input) |
3355 | { | 3359 | { |
3356 | int ch = b_peek(input); /* first character after the $ */ | 3360 | int ch = b_peek(input); /* first character after the $ */ |
3357 | unsigned char quote_mask = dest->o_quote ? 0x80 : 0; | 3361 | unsigned char quote_mask = dest->o_quote ? 0x80 : 0; |
@@ -3409,7 +3413,7 @@ static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *i | |||
3409 | #if ENABLE_HUSH_TICK | 3413 | #if ENABLE_HUSH_TICK |
3410 | case '(': | 3414 | case '(': |
3411 | b_getch(input); | 3415 | b_getch(input); |
3412 | process_command_subs(dest, ctx, input, ")"); | 3416 | process_command_subs(dest, /*ctx,*/ input, ")"); |
3413 | break; | 3417 | break; |
3414 | #endif | 3418 | #endif |
3415 | case '-': | 3419 | case '-': |
@@ -3507,7 +3511,7 @@ static int parse_stream(o_string *dest, struct p_context *ctx, | |||
3507 | b_addqchr(dest, b_getch(input), dest->o_quote); | 3511 | b_addqchr(dest, b_getch(input), dest->o_quote); |
3508 | break; | 3512 | break; |
3509 | case '$': | 3513 | case '$': |
3510 | if (handle_dollar(dest, ctx, input) != 0) { | 3514 | if (handle_dollar(dest, /*ctx,*/ input) != 0) { |
3511 | debug_printf_parse("parse_stream return 1: handle_dollar returned non-0\n"); | 3515 | debug_printf_parse("parse_stream return 1: handle_dollar returned non-0\n"); |
3512 | return 1; | 3516 | return 1; |
3513 | } | 3517 | } |
@@ -3532,7 +3536,7 @@ static int parse_stream(o_string *dest, struct p_context *ctx, | |||
3532 | break; | 3536 | break; |
3533 | #if ENABLE_HUSH_TICK | 3537 | #if ENABLE_HUSH_TICK |
3534 | case '`': | 3538 | case '`': |
3535 | process_command_subs(dest, ctx, input, "`"); | 3539 | process_command_subs(dest, /*ctx,*/ input, "`"); |
3536 | break; | 3540 | break; |
3537 | #endif | 3541 | #endif |
3538 | case '>': | 3542 | case '>': |