COmmand registr-ignored

This commit is contained in:
german 2026-03-23 20:42:11 +04:00
parent d458d65929
commit abc5fef7bd
2 changed files with 17 additions and 1 deletions

View File

@ -199,6 +199,22 @@ typedef struct {
word_t* memory_size; word_t* memory_size;
} ntsys_argument_parser_t; } ntsys_argument_parser_t;
#include <ctype.h>
int __regist_ignore_strcmp(char* str1, char* str2) {
size_t t = strlen(str1);
size_t l2_len = strlen(str2);
size_t i = 0;
while (i < t) {
char i1 = toupper(str1[i]);
char i2 = toupper(i > l2_len ? '\0' : str2[i]);
if (i1 > i2) return 1;
if (i1 < i2) return -1;
i ++;
}
return 0;
}
static void __input_datatype(ntsys_argument_parser_t* parser, byte_t* mode) { static void __input_datatype(ntsys_argument_parser_t* parser, byte_t* mode) {
ntsys_exit_if_error(parser) { ntsys_exit_if_error(parser) {
ntsys_error("Cannot find argument!"); ntsys_error("Cannot find argument!");
@ -391,7 +407,7 @@ static int select_argument(ntsys_argument_parser_t* parser) {
} }
strncpy(buf, table[i], t); strncpy(buf, table[i], t);
buf[t] = '\0'; buf[t] = '\0';
if (strcmp(str, buf) == 0) { if (__regist_ignore_strcmp(str, buf) == 0) {
char* se = &table[i][t + 1]; char* se = &table[i][t + 1];
while (strlen(se) > 1) { while (strlen(se) > 1) {
char is[3]; char is[3];

BIN
ntsys

Binary file not shown.