]> git.xolatile.top Git - public-libhl.git/commitdiff
Merge branch 'master' of https://git.lain.church/emil/hl
authoranon <anon@anon.anon>
Fri, 25 Aug 2023 19:17:00 +0000 (21:17 +0200)
committeranon <anon@anon.anon>
Fri, 25 Aug 2023 19:17:00 +0000 (21:17 +0200)
1  2 
source/hl.h
source/regex.c

diff --cc source/hl.h
index 7b007149f39b9a071dafe1bd7c35c0e428730888,7c08fe134ad0e65433bdf4fec267c1dfd0306608..a46080b50630f05b3c3b707f1ee188087cc3805b
@@@ -191,13 -196,13 +195,13 @@@ int token_fits(const token_t * cons
  void render_string(const char * const string,
                     const char * const mode) {
        for (const char * s = string; *s != '\00';) {
-               int f = 0;
+               int    f           = 0;
                size_t token_index = 0;
-               int offset;
+               int    offset      = 0;
  
                for (; token_index < token_table.element_count; token_index++) {
 -                      token_t * t = vector_get(&token_table,
 -                                                token_index);
 +                      token_t * t = *(token_t**)vector_get(&token_table,
 +                                                           token_index);
                        f = token_fits(t, string, s - string, &offset);
                        if (f) {
                                break;
diff --cc source/regex.c
index 36e6a429ba706334f425f1bdf88f8a06141401d7,9bba03914c7f840b065b6f0c8e7a6dc893f4cc83..39d5c9556662b05ac9fbf003a0fac1a6d45bfc22
@@@ -359,8 -353,8 +359,8 @@@ void HOOK_ALL(int              from
  regex_t * regex_compile(const char * const pattern) {
        regex_t * regex = (regex_t *)malloc(sizeof(regex_t));
        regex->str = strdup(pattern);
-       vector_init(&regex->delta_table, sizeof(delta_t), 0UL);
-       vector_init(&regex->catch_table, sizeof(offshoot_t), 0UL);
 -      vector_init(regex.delta_table, sizeof(delta_t), 0);
 -      vector_init(regex.catch_table, sizeof(offshoot_t), 0);
++      vector_init(&regex->delta_table, sizeof(delta_t*), 0UL);
++      vector_init(&regex->catch_table, sizeof(offshoot_t*), 0UL);
  
        int state = 0;