fix: language & format

This commit is contained in:
javalsai 2025-06-21 00:54:36 +02:00
parent e7ef64cd16
commit 6d30e889d5
Signed by: javalsai
SSH Key Fingerprint: SHA256:3G83yKhBUWVABVX/vPWH88xnK4+ptMtHkZGCRXD4Mk8
4 changed files with 16 additions and 12 deletions

View File

@ -12,7 +12,8 @@ struct status {
}; };
int read_desktop(FILE* NNULLABLE fd, void* UNULLABLE ctx, int read_desktop(FILE* NNULLABLE fd, void* UNULLABLE ctx,
struct status (*NNULLABLE cb)(void* UNULLABLE ctx, char* NULLABLE table, struct status (*NNULLABLE cb)(void* UNULLABLE ctx,
char* NULLABLE table,
char* NNULLABLE key, char* NNULLABLE key,
char* NNULLABLE value)); char* NNULLABLE value));

View File

@ -127,10 +127,10 @@ struct parser_error parse_key(enum introspection_type typ, union typ_ptr at,
if (!aux_str) FAIL("allocation failure"); if (!aux_str) FAIL("allocation failure");
aux_err = parse_str_inplace(aux_str); aux_err = parse_str_inplace(aux_str);
if (aux_err.msg != NULL) return aux_err; if (aux_err.msg != NULL) return aux_err;
// FIXME: it be broken, prob the ptr arithmetic or smth, we mem leak instead 😎 // FIXME: it be broken, prob the ptr arithmetic or smth, we mem leak
// If the ptr is not the default it means it was prev allocated, we should // instead 😎 If the ptr is not the default it means it was prev
// free // allocated, we should free if (*(char**)((uintptr_t)(&default_config) +
// if (*(char**)((uintptr_t)(&default_config) + offset) != *at.string) { // offset) != *at.string) {
// free(*at.string); // free(*at.string);
// } // }
*at.string = aux_str; *at.string = aux_str;

View File

@ -33,11 +33,12 @@ void ofield_kbd_type(struct opts_field* self, char* typed,
} }
bool ofield_opts_seek(struct opts_field* self, char seek) { bool ofield_opts_seek(struct opts_field* self, char seek) {
// no options or (a single option but its selected isntead of on edit) // no options or (a single option but its selected instead of on edit)
if (self->opts == 0 || (self->opts == 1 && self->current_opt != 0)) if (self->opts == 0 || (self->opts == 1 && self->current_opt != 0))
return false; return false;
self->current_opt = 1 + ((self->current_opt - 1 + seek + self->opts) % self->opts); self->current_opt =
1 + ((self->current_opt - 1 + seek + self->opts) % self->opts);
ui_update_ofield(self); ui_update_ofield(self);
return true; return true;
} }

View File

@ -90,11 +90,13 @@ size_t utf8len_until(const char* str, const char* until) {
} }
const char* utf8back(const char* str) { const char* utf8back(const char* str) {
while(utf8_iscont(*(--str))) {} while (utf8_iscont(*(--str))) {
}
return str; return str;
} }
const char* utf8seek(const char* str) { const char* utf8seek(const char* str) {
while(utf8_iscont(*(++str))) {} while (utf8_iscont(*(++str))) {
}
return str; return str;
} }