summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2014-09-15 09:38:02 -0400
committerPaul Smith <psmith@gnu.org>2014-09-15 09:42:52 -0400
commit562344122f3a3327ca4e285f203355857c4a25ff (patch)
tree4b24149819dc243c1ff0c4f064f82844a07e6f53
parent9a2451af0bc086635d9ad16468a3d30de4f5e86f (diff)
downloadgunmake-562344122f3a3327ca4e285f203355857c4a25ff.tar.gz
* loadapi.c (gmk_eval): [SV 43221] Preserve var buff content for eval.
-rw-r--r--loadapi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/loadapi.c b/loadapi.c
index 0568cbd..acf6f84 100644
--- a/loadapi.c
+++ b/loadapi.c
@@ -39,9 +39,17 @@ gmk_free (char *s)
void
gmk_eval (const char *buffer, const gmk_floc *floc)
{
+ /* Preserve existing variable buffer context. */
+ char *pbuf;
+ unsigned int plen;
+
+ install_variable_buffer (&pbuf, &plen);
+
char *s = xstrdup (buffer);
eval_buffer (s, floc);
free (s);
+
+ restore_variable_buffer (pbuf, plen);
}
/* Expand a string and return an allocated buffer.