20 int wordexp_ros(
const char *words, wordexp_t *pwordexp,
int flags) {
21 bool should_unset_home =
false;
22 if (
nullptr == getenv(
"HOME") &&
nullptr != getenv(
"ROS_HOME")) {
24 should_unset_home =
true;
25 setenv(
"HOME", getenv(
"ROS_HOME"),
true);
28 int wordexp_result = wordexp(words, pwordexp, flags);
29 if (should_unset_home) {
32 return wordexp_result;
int wordexp_ros(const char *words, wordexp_t *pwordexp, int flags)
Provide wordexp-like behavior, with one difference: in the case that $HOME is not defined - use $ROS_...