cleanup
This commit is contained in:
parent
6a965ab8f2
commit
e348f58108
11
main.cc
11
main.cc
|
@ -59,6 +59,10 @@ static bool ob_check_exec(ConstCharRange tname,
|
||||||
return ob_check_ts(tname, deps);
|
return ob_check_ts(tname, deps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ConstCharRange ob_get_env(ConstCharRange ename) {
|
||||||
|
return getenv(ostd::String(ename).data());
|
||||||
|
}
|
||||||
|
|
||||||
/* this lets us properly match % patterns in target names */
|
/* this lets us properly match % patterns in target names */
|
||||||
static ConstCharRange ob_compare_subst(ConstCharRange expanded,
|
static ConstCharRange ob_compare_subst(ConstCharRange expanded,
|
||||||
ConstCharRange toexpand) {
|
ConstCharRange toexpand) {
|
||||||
|
@ -425,11 +429,10 @@ int main(int argc, char **argv) {
|
||||||
cs.result->set_cstr("");
|
cs.result->set_cstr("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char *ret = getenv(args[0].get_str().data());
|
auto ret = ob_get_env(args[0].get_str());
|
||||||
if (!ret || !ret[0]) {
|
if (ret.empty())
|
||||||
cs.result->set_cstr("");
|
cs.result->set_cstr("");
|
||||||
return;
|
else
|
||||||
}
|
|
||||||
cs.result->set_str_dup(ret);
|
cs.result->set_str_dup(ret);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue