Skip to content

Commit

Permalink
Allow appvar names to begin with lowercase letters. Fixes #463.
Browse files Browse the repository at this point in the history
  • Loading branch information
calc84maniac committed Jul 9, 2024
1 parent 22fed2f commit 31dff66
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/usb/dusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ static bool dusb_convert_varname_to_utf8(dusb_command_t *command) {
return false;
}
fallthrough;
default:
case CALC_VAR_TYPE_PROG:
case CALC_VAR_TYPE_PROT_PROG:
case CALC_VAR_TYPE_TEMP_PROG:
if (command->varname[0] < 'A' || command->varname[0] > 'Z' + 1) {
return false;
}
Expand Down Expand Up @@ -341,6 +343,13 @@ static bool dusb_convert_varname_to_utf8(dusb_command_t *command) {
tiascii[5] += 1 + command->varname[1];
}
break;
default:
if (command->varname[0] < 'A' || (command->varname[0] > 'Z' + 1 && command->varname[0] < 'a') || command->varname[0] > 'z') {
return false;
}
memcpy(tiascii, command->varname, command->varname_length);
tiascii[command->varname_length] = '\0';
break;
}

command->varname_utf8_length = 0;
Expand Down

0 comments on commit 31dff66

Please sign in to comment.