summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-24 22:00:51 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-24 22:00:51 -0800
commit77a5bd52ac777a95a22395227f29084e49569370 (patch)
treee8757e7a1c213e3459e1f43701057153ac346124 /parse/node.c
parent3dc461b0b09aae0b89c6310fe572f1bd7f693395 (diff)
downloadmc-77a5bd52ac777a95a22395227f29084e49569370.tar.gz
Fix scoping issues.
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse/node.c b/parse/node.c
index 62a6941..63d26c2 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -471,7 +471,10 @@ int nameeq(void *p1, void *p2)
void setns(Node *n, char *ns)
{
- assert(!n->name.ns || !strcmp(n->name.ns, ns));
+ assert(!ns || !n->name.ns || !strcmp(n->name.ns, ns));
+
+ if (!ns)
+ return;
n->name.ns = strdup(ns);
}