Repair truncation in oldstyle mode.

Sure would be nice to remember while this code had TOKEN + TOKEN
where one would think it should just say TOKEN.
This commit is contained in:
Eric S. Raymond 2024-09-20 10:49:44 -04:00
parent acdfa96315
commit cf4adf8d02

3
misc.c
View file

@ -514,8 +514,7 @@ static void tokenize(char *raw, command_t *cmd) {
* possible an emulation of the original UI. * possible an emulation of the original UI.
*/ */
if (settings.oldstyle) { if (settings.oldstyle) {
cmd->word[0].raw[TOKLEN + TOKLEN] = cmd->word[0].raw[TOKLEN] = cmd->word[1].raw[TOKLEN] = '\0';
cmd->word[1].raw[TOKLEN + TOKLEN] = '\0';
for (size_t i = 0; i < strlen(cmd->word[0].raw); i++) { for (size_t i = 0; i < strlen(cmd->word[0].raw); i++) {
cmd->word[0].raw[i] = toupper(cmd->word[0].raw[i]); cmd->word[0].raw[i] = toupper(cmd->word[0].raw[i]);
} }