fix for nested backquote expansion; test case, eg, echo `echo ${FOO=\`bar\`}`
authorChris Torek <torek@ucbvax.Berkeley.EDU>
Sat, 23 Oct 1993 01:42:14 +0000 (17:42 -0800)
committerChris Torek <torek@ucbvax.Berkeley.EDU>
Sat, 23 Oct 1993 01:42:14 +0000 (17:42 -0800)
SCCS-vsn: bin/sh/expand.c 8.2

usr/src/bin/sh/expand.c

index f4960f8..c03eac1 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)expand.c   8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)expand.c   8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -459,10 +459,12 @@ again: /* jump here after setting a variable with ${var=text} */
                } else {
                        char *startp;
                        int saveherefd = herefd;
                } else {
                        char *startp;
                        int saveherefd = herefd;
+                       struct nodelist *saveargbackq = argbackq;
                        herefd = -1;
                        argstr(p, 0);
                        STACKSTRNUL(expdest);
                        herefd = saveherefd;
                        herefd = -1;
                        argstr(p, 0);
                        STACKSTRNUL(expdest);
                        herefd = saveherefd;
+                       argbackq = saveargbackq;
                        startp = stackblock() + startloc;
                        if (subtype == VSASSIGN) {
                                setvar(var, startp, 0);
                        startp = stackblock() + startloc;
                        if (subtype == VSASSIGN) {
                                setvar(var, startp, 0);