From 536d1856f0601d92d7b4575feb222689d5f0f722 Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Fri, 22 May 2015 01:32:45 +0200 Subject: [PATCH] .IF B,< > is supposed to be TRUE because spaces are blank. Seen in Kermit, although perhaps the author didn't mean that (MESSAGE < >). --- assemble.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/assemble.c b/assemble.c index 5cda79d..07d457e 100644 --- a/assemble.c +++ b/assemble.c @@ -758,26 +758,24 @@ static int assemble( cp = value->cp; ok = eval_undefined(value); free_tree(value); - } else if (strcmp(label, "B") == 0) { + } else if (strcmp(label, "B") == 0 || + strcmp(label, "NB") == 0) { char *thing; cp = skipwhite(cp); - if (!EOL(*cp)) - thing = getstring(cp, &cp); - else - thing = memcheck(strdup("")); - ok = (*thing == 0); - free(thing); - } else if (strcmp(label, "NB") == 0) { - char *thing; + if (EOL(*cp)) { + ok = 1; + } else { + char *thing, *end; - cp = skipwhite(cp); - if (!EOL(*cp)) thing = getstring(cp, &cp); - else - thing = memcheck(strdup("")); - ok = (*thing != 0); - free(thing); + end = skipwhite(thing); + ok = (*end == 0); + free(thing); + } + if (label[0] == 'N') { + ok = !ok; + } } else if (strcmp(label, "IDN") == 0) { char *thing1, *thing2;