technical dept payed back

This commit is contained in:
anon 2023-09-25 22:35:17 +02:00
parent 8f2fbcdb2b
commit aa3dd43fc5

View File

@ -535,12 +535,6 @@ regex_t * regex_compile(const char * const pattern) {
} break; } break;
} }
/* Ew */
if (*s == '\\'
&& is_hologram_escape(*(s+1))) {
++s;
}
// Compile char // Compile char
switch (*s) { switch (*s) {
// holograms // holograms
@ -555,6 +549,13 @@ regex_t * regex_compile(const char * const pattern) {
} }
s += 1; s += 1;
} break; } break;
case '\\': {
if(is_hologram_escape(*(s+1))) {
++s;
} else {
goto DEFAULT;
}
switch(*s){
case '<': { case '<': {
// XXX: make this legible // XXX: make this legible
if (cs.flags & IS_AT_THE_BEGINNING if (cs.flags & IS_AT_THE_BEGINNING
@ -599,6 +600,8 @@ regex_t * regex_compile(const char * const pattern) {
++cs.state; ++cs.state;
s += 1; s += 1;
} break; } break;
}
} break;
// quantifiers // quantifiers
case '=': case '=':
case '?': { case '?': {
@ -631,6 +634,7 @@ regex_t * regex_compile(const char * const pattern) {
} }
s += 1; s += 1;
} break; } break;
DEFAULT:
default: { // Literal default: { // Literal
cs.flags |= INCREMENT_STATE; cs.flags |= INCREMENT_STATE;
HOOK_ALL(0, whitelist, +1, &cs, regex); HOOK_ALL(0, whitelist, +1, &cs, regex);