diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-09-06 17:35:20 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-09-06 17:35:20 +0000 |
commit | 2bf218ca2e730cc24b61c5a818659c940bcfc150 (patch) | |
tree | c61aef5eee53abff53154f8ed411259af254bb7a /shell | |
parent | 3f904d50b16a0ff58c1e3bf4046d5aa282ebdd13 (diff) | |
download | busybox-w32-2bf218ca2e730cc24b61c5a818659c940bcfc150.tar.gz busybox-w32-2bf218ca2e730cc24b61c5a818659c940bcfc150.tar.bz2 busybox-w32-2bf218ca2e730cc24b61c5a818659c940bcfc150.zip |
Patch from vodz to make ash cope with leading redirections
(i.e. '2>/dev/null ls rubbish') will now work.
git-svn-id: svn://busybox.net/trunk/busybox@3401 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index 53fb56c2c..bd34c0efb 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9857,6 +9857,14 @@ command() { | |||
9857 | n1 = NULL; | 9857 | n1 = NULL; |
9858 | rpp = &redir; | 9858 | rpp = &redir; |
9859 | 9859 | ||
9860 | /* Check for redirection which may precede command */ | ||
9861 | while (readtoken() == TREDIR) { | ||
9862 | *rpp = n2 = redirnode; | ||
9863 | rpp = &n2->nfile.next; | ||
9864 | parsefname(); | ||
9865 | } | ||
9866 | tokpushback++; | ||
9867 | |||
9860 | switch (readtoken()) { | 9868 | switch (readtoken()) { |
9861 | case TIF: | 9869 | case TIF: |
9862 | n1 = (union node *)stalloc(sizeof (struct nif)); | 9870 | n1 = (union node *)stalloc(sizeof (struct nif)); |
@@ -10026,7 +10034,6 @@ TRACE(("expecting DO got %s %s\n", tokname(got), got == TWORD ? wordtext : "")); | |||
10026 | if (!redir) | 10034 | if (!redir) |
10027 | synexpect(-1); | 10035 | synexpect(-1); |
10028 | case TWORD: | 10036 | case TWORD: |
10029 | case TREDIR: | ||
10030 | tokpushback++; | 10037 | tokpushback++; |
10031 | n1 = simplecmd(); | 10038 | n1 = simplecmd(); |
10032 | return n1; | 10039 | return n1; |
@@ -12673,7 +12680,7 @@ findvar(struct var **vpp, const char *name) | |||
12673 | /* | 12680 | /* |
12674 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> | 12681 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> |
12675 | * This file contains code for the times builtin. | 12682 | * This file contains code for the times builtin. |
12676 | * $Id: ash.c,v 1.22 2001/08/12 17:32:56 mjn3 Exp $ | 12683 | * $Id: ash.c,v 1.23 2001/09/06 17:35:20 andersen Exp $ |
12677 | */ | 12684 | */ |
12678 | static int timescmd (int argc, char **argv) | 12685 | static int timescmd (int argc, char **argv) |
12679 | { | 12686 | { |