From 82a8c819f3d4b3634154831a33a4cad9fc5aa5b7 Mon Sep 17 00:00:00 2001 From: tegge Date: Tue, 13 Apr 1999 04:13:09 +0000 Subject: During variable expansion, the internal representation of the expression might be relocated. Handle this case. PR: 7059 --- bin/sh/expand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin/sh/expand.c') diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 8a6f03a..074b32a 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; #endif static const char rcsid[] = - "$Id: expand.c,v 1.24 1998/09/13 19:24:57 tegge Exp $"; + "$Id: expand.c,v 1.25 1999/04/09 15:23:48 tegge Exp $"; #endif /* not lint */ #include @@ -646,7 +646,7 @@ evalvar(p, flag) int varflags; char *var; char *val; - char *pat; + int patloc; int c; int set; int special; @@ -744,10 +744,10 @@ record: * right after it */ STPUTC('\0', expdest); - pat = expdest; - if (subevalvar(p, NULL, expdest - stackblock(), subtype, + patloc = expdest - stackblock(); + if (subevalvar(p, NULL, patloc, subtype, startloc, varflags) == 0) { - int amount = (expdest - pat) + 1; + int amount = (expdest - stackblock() - patloc) + 1; STADJUST(-amount, expdest); } /* Remove any recorded regions beyond start of variable */ -- cgit v1.1