Skip to content
Myr

path: initialize lower-case title, and the title-length fields

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This fixes a regression introduced when caching the lower-case strings, and their lengths, used when matching. Closes #387

authored by Daniel Eklöf · committed by markstos · parent 8cfb3f8 · Browse files · 1 file+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−0 removed

  • other:+8 added−0 removed

1 file+8 added−0 removed

modified:path.c+8 added
69 unmodified lines
70 }71 size_t exec_size = path_size + 1 + strlen(e->d_name) + 1;72 char *exec = malloc(exec_size);73 snprintf(exec, exec_size, "%s/%s", tok, e->d_name);7475 char32_t *lowercase = c32dup(wtitle);76 for (size_t i = 0; i < c32len(lowercase); i++)77 lowercase[i] = toc32lower(lowercase[i]);7879 struct application *app = malloc(sizeof(*app));80 *app = (struct application){81 .index = 0, /* Not used in application mode */82 .title = wtitle,83 .title_lowercase = lowercase,84 .title_len = c32len(lowercase),85 .exec = exec,86 .visible = true,87 };88
15 unmodified lines