diff options
author | 2004-12-13 16:37:06 +0000 | |
---|---|---|
committer | 2004-12-13 16:37:06 +0000 | |
commit | a617c6c6ba9b7176e9fd0aba705a95c3e3d3e6c6 (patch) | |
tree | 7952d0fc377fa381f639d6c31ee5805f989f2a68 | |
parent | whitespace botches (diff) | |
download | wireguard-openbsd-a617c6c6ba9b7176e9fd0aba705a95c3e3d3e6c6.tar.xz wireguard-openbsd-a617c6c6ba9b7176e9fd0aba705a95c3e3d3e6c6.zip |
Restore sp before calling snptreef() so the error message contains
the actual expression that caused the error. OK otto@
-rw-r--r-- | bin/ksh/eval.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c index 9f2a5a51492..f8ebe29371b 100644 --- a/bin/ksh/eval.c +++ b/bin/ksh/eval.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.17 2004/12/09 11:32:07 otto Exp $ */ +/* $OpenBSD: eval.c,v 1.18 2004/12/13 16:37:06 millert Exp $ */ /* * Expansion - quoting, separation, substitution, globbing @@ -292,12 +292,12 @@ expand(cp, wp, f) char endc; char *str, *end; + sp = varname - 2; /* restore sp */ end = (char *) wdscan(sp, CSUBST); /* ({) the } or x is already skipped */ endc = *end; *end = EOS; - str = snptreef((char *) 0, 64, "%S", - varname - 1); + str = snptreef(NULL, 64, "%S", sp); *end = endc; errorf("%s: bad substitution", str); } |