force elements to be lowercase

This commit is contained in:
biglyderv 2025-03-26 22:15:43 -04:00
parent 34d2d97c82
commit 0fd6e738d9
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
2 changed files with 7 additions and 5 deletions

View file

@ -1,5 +1,4 @@
#include "map.h"
#include <ctype.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -243,10 +242,6 @@ int get_command(char *command, char *command_re, char **sort_tmp) {
command[cl - 1] = '\0';
for (int i = 0; i < cl - 1; i++) {
command[i] = tolower(command[i]);
}
sort_tmp[0] = command;
int combos = 0;
for (int i = 1; i < MAX_COMBO_LENGTH; i++) {

View file

@ -1,5 +1,6 @@
#include "command.h"
#include "loader.h"
#include <ctype.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@ -58,6 +59,12 @@ int main(int argc, char *argv[]) {
printf("\n");
fgets(command, MAX_BUF_LENGTH - 1, stdin);
int cl = strlen(command);
for (int i = 0; i < cl - 1; i++) {
command[i] = tolower(command[i]);
}
if (wasCombination && suggest_command(command, command_re, polls, name)) {
wasCombination = 0;
continue;