From cab63eedd4ae6cca071cbeb078a154d7abfaf582 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 2 May 2015 11:18:30 +0200 Subject: [PATCH] frontend/com_let.c, bug fix, "#302 Integer in Let Statement" let 2foo = someexpression was silently accepted, even though 2foo is an illegal identifier. (first letter is a digit) This was especially irritating, since print 2foo has a legal meaning, 2 femto oO, which is 2e-15 (whatever Unit an oO might be) Reported by Justin Fisher in http://sourceforge.net/p/ngspice/bugs/302/ --- src/frontend/com_let.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/com_let.c b/src/frontend/com_let.c index 37117be1e..6be08c4ce 100644 --- a/src/frontend/com_let.c +++ b/src/frontend/com_let.c @@ -123,7 +123,7 @@ com_let(wordlist *wl) *++q = '\0'; /* sanity check */ - if (eq(p, "all") ||strchr(p, '@')) { + if (eq(p, "all") || strchr(p, '@') || isdigit(*p)) { fprintf(cp_err, "Error: bad variable name %s\n", p); tfree(p); return;