~mcf/samurai

11afcfe02d65e1bbf04800cf8c81b6518c25cfc1 — Michael Forney 3 months ago 00bc958
env: Fix const-ness of cycle sentinel

The intent was to make the pointer itself const so that it could
be added to the read-only data section.
1 files changed, 2 insertions(+), 2 deletions(-)

M env.c
M env.c => env.c +2 -2
@@ 211,7 211,7 @@ ruleaddvar(struct rule *r, char *var, struct evalstring *val)
struct string *
edgevar(struct edge *e, char *var, bool escape)
{
	static const void *cycle = &cycle;
	static void *const cycle = (void *)&cycle;
	struct evalstring *str, *p;
	struct treenode *n;
	size_t len;


@@ 231,7 231,7 @@ edgevar(struct edge *e, char *var, bool escape)
	if (n->value == cycle)
		fatal("cycle in rule variable involving '%s'", var);
	str = n->value;
	n->value = (void *)cycle;
	n->value = cycle;
	len = 0;
	for (p = str; p; p = p->next) {
		if (p->var)