summaryrefslogtreecommitdiffstats
path: root/common/hush.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-06-04 21:03:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-06-04 21:03:36 +0200
commit6331e58a2c99009587eeb2252d0c6ac9de882c1c (patch)
tree8e0765c965faf098151107a7374cd3b554811868 /common/hush.c
parent4c37b77af4759b65058c3aee5eed4d809ac96d84 (diff)
parentae6d0b9b26dd0a28b93a227bcdc15053a99c7a88 (diff)
downloadbarebox-6331e58a2c99009587eeb2252d0c6ac9de882c1c.tar.gz
Merge branch 'for-next/misc'
Conflicts: commands/devinfo.c
Diffstat (limited to 'common/hush.c')
-rw-r--r--common/hush.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/common/hush.c b/common/hush.c
index 09239cd..6be43cf 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -734,6 +734,7 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
char *p;
glob_t globbuf = {};
int ret;
+ int rcode;
# if __GNUC__
/* Avoid longjmp clobbering */
(void) &i;
@@ -753,8 +754,6 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
child = &pi->progs[0];
if (child->group) {
- int rcode;
-
debug("non-subshell grouping\n");
rcode = run_list_real(ctx, child->group);
@@ -789,7 +788,9 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
free(name);
p = insert_var_value(child->argv[i]);
- set_local_var(p, export_me);
+ rcode = set_local_var(p, export_me);
+ if (rcode)
+ return 1;
if (p != child->argv[i])
free(p);
@@ -798,7 +799,9 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
}
for (i = 0; is_assignment(child->argv[i]); i++) {
p = insert_var_value(child->argv[i]);
- set_local_var(p, 0);
+ rcode = set_local_var(p, 0);
+ if (rcode)
+ return 1;
if (p != child->argv[i]) {
child->sp--;
@@ -808,7 +811,6 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
if (child->sp) {
char * str = NULL;
struct p_context ctx1;
- int rcode;
str = make_string((child->argv + i));
rcode = parse_string_outer(&ctx1, str, FLAG_EXIT_FROM_LOOP | FLAG_REPARSING);