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/
This commit is contained in:
parent
7bc6374138
commit
cab63eedd4
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue