summaryrefslogtreecommitdiff
path: root/loadapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'loadapi.c')
-rw-r--r--loadapi.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/loadapi.c b/loadapi.c
index fb275dd..14b75f8 100644
--- a/loadapi.c
+++ b/loadapi.c
@@ -1,5 +1,5 @@
/* API for GNU Make dynamic objects.
-Copyright (C) 2013-2014 Free Software Foundation, Inc.
+Copyright (C) 2013-2016 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -37,17 +37,29 @@ gmk_free (char *s)
/* Evaluate a buffer as make syntax.
Ideally eval_buffer() will take const char *, but not yet. */
void
-gmk_eval (const char *buffer, const gmk_floc *floc)
+gmk_eval (const char *buffer, const gmk_floc *gfloc)
{
/* Preserve existing variable buffer context. */
char *pbuf;
unsigned int plen;
char *s;
+ floc fl;
+ floc *flp;
+
+ if (gfloc)
+ {
+ fl.filenm = gfloc->filenm;
+ fl.lineno = gfloc->lineno;
+ fl.offset = 0;
+ flp = &fl;
+ }
+ else
+ flp = NULL;
install_variable_buffer (&pbuf, &plen);
s = xstrdup (buffer);
- eval_buffer (s, floc);
+ eval_buffer (s, flp);
free (s);
restore_variable_buffer (pbuf, plen);