Fix for bin/7502, from Tor Egge / FreeBSD. Their commit message:
> During variable expansion, the internal representation of the expression > might be relocated. Handle this case.
This commit is contained in:
parent
c7ea24c151
commit
e97b0193be
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: expand.c,v 1.46 1999/04/06 21:05:27 he Exp $ */
|
/* $NetBSD: expand.c,v 1.47 1999/04/30 17:54:17 he Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1991, 1993
|
* Copyright (c) 1991, 1993
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
|
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: expand.c,v 1.46 1999/04/06 21:05:27 he Exp $");
|
__RCSID("$NetBSD: expand.c,v 1.47 1999/04/30 17:54:17 he Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ evalvar(p, flag)
|
||||||
int varflags;
|
int varflags;
|
||||||
char *var;
|
char *var;
|
||||||
char *val;
|
char *val;
|
||||||
char *pat;
|
int patloc;
|
||||||
int c;
|
int c;
|
||||||
int set;
|
int set;
|
||||||
int special;
|
int special;
|
||||||
|
@ -720,10 +720,10 @@ record:
|
||||||
* right after it
|
* right after it
|
||||||
*/
|
*/
|
||||||
STPUTC('\0', expdest);
|
STPUTC('\0', expdest);
|
||||||
pat = expdest;
|
patloc = expdest - stackblock();
|
||||||
if (subevalvar(p, NULL, expdest - stackblock(), subtype,
|
if (subevalvar(p, NULL, patloc, subtype,
|
||||||
startloc, varflags) == 0) {
|
startloc, varflags) == 0) {
|
||||||
int amount = (expdest - pat) + 1;
|
int amount = (expdest - stackblock() - patloc) + 1;
|
||||||
STADJUST(-amount, expdest);
|
STADJUST(-amount, expdest);
|
||||||
}
|
}
|
||||||
/* Remove any recorded regions beyond start of variable */
|
/* Remove any recorded regions beyond start of variable */
|
||||||
|
|
Loading…
Reference in New Issue