SCP: During expression evaluation, make lookups (REG, Env) consistent

Both REGister and Environment Variable name lookup now do a precise
name lookup with the presented name followed by an upcased name
lookup.
This commit is contained in:
Mark Pizzolato 2020-05-12 03:57:22 -07:00
parent c3fef9befc
commit 8edb55ac87

10
scp.c
View file

@ -15046,8 +15046,16 @@ if (sim_isalpha (*data) || (*data == '_')) {
rptr = find_reg (data, &gptr, dptr);
}
}
else
else {
rptr = find_reg_glob (data, &gptr, &dptr);
if (!rptr) { /* Register not found? */
char tbuf[CBUFSIZE];
get_glyph (data, tbuf, 0); /* try using the upcased name */
if (strcmp (data, tbuf)) /* upcase different? */
rptr = find_reg_glob (tbuf, &gptr, &dptr);/* lookup the upcase name */
}
}
if (rptr) {
*svalue = (t_svalue)get_rval (rptr, 0);
sprint_val (string, *svalue, 10, string_size - 1, PV_LEFTSIGN);