diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-19 16:00:57 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-19 16:00:57 +0100 |
commit | b8d076b00bad9da87e6dcaf4f36dfd06e2d2e5e8 (patch) | |
tree | eca9c0ab6776f5c098fd3b136d67e5dbb1145722 | |
parent | 6aad1ddcc9d8fe2303cc444b6ddea2af1fc1dd30 (diff) | |
download | busybox-w32-b8d076b00bad9da87e6dcaf4f36dfd06e2d2e5e8.tar.gz busybox-w32-b8d076b00bad9da87e6dcaf4f36dfd06e2d2e5e8.tar.bz2 busybox-w32-b8d076b00bad9da87e6dcaf4f36dfd06e2d2e5e8.zip |
hush: fix build if !BASH_LINENO_VAR
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/shell/hush.c b/shell/hush.c index 8ba48de95..85526a9f0 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -938,9 +938,6 @@ struct globals { | |||
938 | #if BASH_LINENO_VAR | 938 | #if BASH_LINENO_VAR |
939 | unsigned lineno; | 939 | unsigned lineno; |
940 | char *lineno_var; | 940 | char *lineno_var; |
941 | # define G_lineno_var G.lineno_var | ||
942 | #else | ||
943 | # define G_lineno_var ((char*)NULL) | ||
944 | #endif | 941 | #endif |
945 | struct FILE_list *FILE_list; | 942 | struct FILE_list *FILE_list; |
946 | /* Which signals have non-DFL handler (even with no traps set)? | 943 | /* Which signals have non-DFL handler (even with no traps set)? |
@@ -6551,13 +6548,17 @@ static void parse_and_run_string(const char *s) | |||
6551 | static void parse_and_run_file(FILE *f) | 6548 | static void parse_and_run_file(FILE *f) |
6552 | { | 6549 | { |
6553 | struct in_str input; | 6550 | struct in_str input; |
6551 | #if BASH_LINENO_VAR | ||
6554 | unsigned sv; | 6552 | unsigned sv; |
6555 | 6553 | ||
6556 | setup_file_in_str(&input, f); | ||
6557 | sv = G.lineno; | 6554 | sv = G.lineno; |
6558 | G.lineno = 1; | 6555 | G.lineno = 1; |
6556 | #endif | ||
6557 | setup_file_in_str(&input, f); | ||
6559 | parse_and_run_stream(&input, ';'); | 6558 | parse_and_run_stream(&input, ';'); |
6559 | #if BASH_LINENO_VAR | ||
6560 | G.lineno = sv; | 6560 | G.lineno = sv; |
6561 | #endif | ||
6561 | } | 6562 | } |
6562 | 6563 | ||
6563 | #if ENABLE_HUSH_TICK | 6564 | #if ENABLE_HUSH_TICK |
@@ -8104,8 +8105,10 @@ static NOINLINE int run_pipe(struct pipe *pi) | |||
8104 | char **new_env = NULL; | 8105 | char **new_env = NULL; |
8105 | struct variable *old_vars = NULL; | 8106 | struct variable *old_vars = NULL; |
8106 | 8107 | ||
8107 | if (G_lineno_var) | 8108 | #if BASH_LINENO_VAR |
8108 | strcpy(G_lineno_var + sizeof("LINENO=")-1, utoa(command->lineno)); | 8109 | if (G.lineno_var) |
8110 | strcpy(G.lineno_var + sizeof("LINENO=")-1, utoa(command->lineno)); | ||
8111 | #endif | ||
8109 | 8112 | ||
8110 | if (argv[command->assignment_cnt] == NULL) { | 8113 | if (argv[command->assignment_cnt] == NULL) { |
8111 | /* Assignments, but no command */ | 8114 | /* Assignments, but no command */ |
@@ -8311,8 +8314,10 @@ static NOINLINE int run_pipe(struct pipe *pi) | |||
8311 | if (cmd_no < pi->num_cmds) | 8314 | if (cmd_no < pi->num_cmds) |
8312 | xpiped_pair(pipefds); | 8315 | xpiped_pair(pipefds); |
8313 | 8316 | ||
8314 | if (G_lineno_var) | 8317 | #if BASH_LINENO_VAR |
8315 | strcpy(G_lineno_var + sizeof("LINENO=")-1, utoa(command->lineno)); | 8318 | if (G.lineno_var) |
8319 | strcpy(G.lineno_var + sizeof("LINENO=")-1, utoa(command->lineno)); | ||
8320 | #endif | ||
8316 | 8321 | ||
8317 | command->pid = BB_MMU ? fork() : vfork(); | 8322 | command->pid = BB_MMU ? fork() : vfork(); |
8318 | if (!command->pid) { /* child */ | 8323 | if (!command->pid) { /* child */ |