From d696707cb5009308baa345ff60c8378512b07edb Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 25 Oct 2002 22:01:47 +0000 Subject: Fix eval bugs 1516 and 1517. --- expand.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'expand.c') diff --git a/expand.c b/expand.c index 5c2c3e2..ac4ccda 100644 --- a/expand.c +++ b/expand.c @@ -545,3 +545,28 @@ allocated_variable_expand_for_file (char *line, struct file *file) return value; } + +/* Install a new variable_buffer context, returning the current one for + safe-keeping. */ + +void +install_variable_buffer (char **bufp, unsigned int *lenp) +{ + *bufp = variable_buffer; + *lenp = variable_buffer_length; + + variable_buffer = 0; + initialize_variable_output (); +} + +/* Restore a previously-saved variable_buffer setting (free the current one). + */ + +void +restore_variable_buffer (char *buf, unsigned int len) +{ + free (variable_buffer); + + variable_buffer = buf; + variable_buffer_length = len; +} -- cgit v1.2.3