ash: [REDIR] Fix popredir on abnormal exit from built-in
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 29 Jul 2017 20:51:52 +0000 (22:51 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 29 Jul 2017 20:51:52 +0000 (22:51 +0200)
commit1c79aeb6a8cae4cd4013926b97f39305b689d74c
treee23825c6a84c1c95c2285fc54e5cce4f129660f7
parent469998015f57a552718420a4050d90e5dae6a6fd
ash: [REDIR] Fix popredir on abnormal exit from built-in

Upstream commit:

    Date: Thu, 27 May 2010 15:03:46 +0800
    [REDIR] Fix popredir on abnormal exit from built-in

    Just like the poplocalvar problem recently fixed, redirections
    can also be leaked in case of an abnormal exit.  This patch fixes
    it using the same method as poplocalvar, by storing the previous
    redirection state and restoring to that point.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c