Further tweaks to config parsing and error reporting (#1559)

* Further tweaks to config parsing and error reporting

* Fix static builds
This commit is contained in:
trapexit 2025-11-01 15:20:30 -05:00 • committed by GitHub
parent ec16d07fba
commit 2412ae7316
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 60 additions and 59 deletions

View file

@ -119,37 +119,19 @@ _set_default_options(fuse_args *args_)
SysLog::notice("not auto setting allow_other since not running as root");
}
static
int
_parse_and_process_kv_arg(const std::string &key_,
const std::string &val_)
{
int rv;
std::string key(key_);
std::string val(val_);
if(cfg.has_key(key) == false)
return 1;
rv = cfg.set(key,val);
if(rv < 0)
cfg.errs.push_back({-rv,key+'='+val});
return OPT_DISCARD;
}
static
int
_process_opt(const std::string &arg_)
{
std::string key;
std::string val;
int rv;
str::splitkv(arg_,'=',&key,&val);
key = str::trim(key);
val = str::trim(val);
rv = cfg.set(arg_);
if(rv == -ENOATTR)
return OPT_KEEP;
if(rv < 0)
cfg.errs.push_back({-rv,arg_});
return ::_parse_and_process_kv_arg(key,val);
return OPT_DISCARD;
}
static