fsck: minor refactor

This commit is contained in:
CismonX 2025-01-15 22:44:08 +08:00
parent 95d6ff6b52
commit 57a1a181b8
No known key found for this signature in database
GPG key ID: 3094873E29A482FB
2 changed files with 13 additions and 7 deletions

View file

@ -423,11 +423,16 @@ parse_opts (
}
SUBOPT_OPT_FALLBACK() {
char *opt = SUBOPT_STR;
if (opt[0] == '@') {
bookmarkfs_opts_add(&info->backend_opts, opt + 1);
} else if (opt[0] == '%') {
bookmarkfs_opts_add(&info->handler_opts, opt + 1);
} else {
switch (*(opt++)) {
case '@':
bookmarkfs_opts_add(&info->backend_opts, opt);
break;
case '%':
bookmarkfs_opts_add(&info->handler_opts, opt);
break;
default:
return SUBOPT_ERR_BAD_KEY();
}
}

View file

@ -309,8 +309,9 @@ parse_opts (
}
BACKEND_OPT_KEY("translit") {
BACKEND_OPT_VAL_START
if (1 == strlen(BACKEND_OPT_VAL_STR)) {
translit = BACKEND_OPT_VAL_STR[0];
char const *str = BACKEND_OPT_VAL_STR;
if (str[0] != '\0' && str[0] != '/' && str[1] == '\0') {
translit = str[0];
}
BACKEND_OPT_VAL_END
}