From: Peter Avalos Date: Sun, 5 Feb 2012 19:11:06 +0000 (-0800) Subject: sh: Don't force special builtins non-special in optimized command subst. X-Git-Tag: v3.0.1~44 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/f78f4bac72e24162026ef9087698a1af6cd0eb92 sh: Don't force special builtins non-special in optimized command subst. This is not necessary: errors are already caught in evalbackcmd() and forcelocal handles changes to variables. Obtained-from: FreeBSD 228937 (cherry picked from commit d303b442299ef4e2fd081023559b4a89656d1ebf) --- diff --git a/bin/sh/eval.c b/bin/sh/eval.c index c8eb49a3d9..249505d82b 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)eval.c 8.9 (Berkeley) 6/8/95 - * $FreeBSD: src/bin/sh/eval.c,v 1.114 2011/11/27 00:09:59 jilles Exp $ + * $FreeBSD: src/bin/sh/eval.c,v 1.115 2011/12/28 22:10:12 jilles Exp $ */ #include @@ -981,7 +981,6 @@ evalcommand(union node *cmd, int flgs, struct backcmd *backcmd) memout.nextc = memout.buf; memout.bufsize = 64; mode |= REDIR_BACKQ; - cmdentry.special = 0; } savecmdname = commandname; savetopfile = getcurrentfile(); @@ -1002,7 +1001,7 @@ evalcommand(union node *cmd, int flgs, struct backcmd *backcmd) * If there is no command word, redirection errors should * not be fatal but assignment errors should. */ - if (argc == 0 && !(flags & EV_BACKCMD)) + if (argc == 0) cmdentry.special = 1; listsetvar(cmdenviron, cmdentry.special ? 0 : VNOSET); if (argc > 0)