force elements to be lowercase
This commit is contained in:
parent
34d2d97c82
commit
0fd6e738d9
2 changed files with 7 additions and 5 deletions
|
@ -1,5 +1,4 @@
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -243,10 +242,6 @@ int get_command(char *command, char *command_re, char **sort_tmp) {
|
||||||
|
|
||||||
command[cl - 1] = '\0';
|
command[cl - 1] = '\0';
|
||||||
|
|
||||||
for (int i = 0; i < cl - 1; i++) {
|
|
||||||
command[i] = tolower(command[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
sort_tmp[0] = command;
|
sort_tmp[0] = command;
|
||||||
int combos = 0;
|
int combos = 0;
|
||||||
for (int i = 1; i < MAX_COMBO_LENGTH; i++) {
|
for (int i = 1; i < MAX_COMBO_LENGTH; i++) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
|
#include <ctype.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -58,6 +59,12 @@ int main(int argc, char *argv[]) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
fgets(command, MAX_BUF_LENGTH - 1, stdin);
|
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)) {
|
if (wasCombination && suggest_command(command, command_re, polls, name)) {
|
||||||
wasCombination = 0;
|
wasCombination = 0;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue