From: Paul Smith Date: Mon, 15 Sep 2014 13:38:02 +0000 (-0400) Subject: * loadapi.c (gmk_eval): [SV 43221] Preserve var buff content for eval. X-Git-Tag: 4.1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=562344122f3a3327ca4e285f203355857c4a25ff;p=thirdparty%2Fmake.git * loadapi.c (gmk_eval): [SV 43221] Preserve var buff content for eval. --- diff --git a/loadapi.c b/loadapi.c index 0568cbd4..acf6f844 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.