Skip to content

Commit

Permalink
Fix returning of resource path
Browse files Browse the repository at this point in the history
We are in a while loop and plan to go through all elements of
XDG_DATA_DIRS. So far we actually returned out of it if only the first
path is not containig the OpMon dir, not even checking the other
elements.

Only return the default /usr/local/share/OpMon path if none of the
elements in XDG_DATA_DIRS contain OpMon.

Fixes OpMonTeam/OpMon#52
  • Loading branch information
jubalh committed Jun 8, 2018
1 parent 3c7811e commit 110f178
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ namespace Utils {
std::string data_dir = data_dir_list.substr(0, next_delimiter);
if(!data_dir.empty() && _isFolder(data_dir + "/OpMon")){
return data_dir + "/OpMon/";
}else{
return "/usr/local/share/OpMon/";
}
data_dir_list.erase(0, next_delimiter + 1);
}
return "/usr/local/share/OpMon/";
}
return nullptr;
}
Expand Down

0 comments on commit 110f178

Please sign in to comment.