summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2023-11-23 20:36:53 +0100
committerJoel Klinghed <the_jk@spawned.biz>2023-11-23 20:36:53 +0100
commit54530472a2073e1f979358646ca2cfc8e6b911a5 (patch)
tree317e0adbdcff8e44ce6e9c55aed6ee5260c7fe16
parent44c3db01709da5a5fa5fff663ee46a4e820bda5d (diff)
Updated xdg files (from sawmill)
-rw-r--r--src/xdg.cc10
-rw-r--r--src/xdg.hh2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/xdg.cc b/src/xdg.cc
index b61b4ba..69b2a53 100644
--- a/src/xdg.cc
+++ b/src/xdg.cc
@@ -86,22 +86,22 @@ void get_paths(Type type, std::string* dirs, std::filesystem::path* home) {
} // namespace
void paths_to_read(Type type, std::string_view name,
- std::vector<std::filesystem::path>* out) {
+ std::vector<std::filesystem::path>& out) {
std::string dirs;
std::filesystem::path home;
get_paths(type, &dirs, &home);
- out->clear();
- out->push_back(home / name);
+ out.clear();
+ out.push_back(home / name);
size_t last = 0;
while (true) {
size_t next = dirs.find(':', last);
if (next == std::string::npos) {
if (valid(dirs, last, dirs.size() - last))
- out->push_back(std::filesystem::path(dirs.substr(last)) / name);
+ out.push_back(std::filesystem::path(dirs.substr(last)) / name);
break;
}
if (valid(dirs, last, next - last))
- out->push_back(
+ out.push_back(
std::filesystem::path(dirs.substr(last, next - last)) / name);
last = next + 1;
}
diff --git a/src/xdg.hh b/src/xdg.hh
index 1c7e4f0..9232bbe 100644
--- a/src/xdg.hh
+++ b/src/xdg.hh
@@ -14,7 +14,7 @@ enum class Type {
};
void paths_to_read(Type type, std::string_view path,
- std::vector<std::filesystem::path>* out);
+ std::vector<std::filesystem::path>& out);
std::filesystem::path path_to_write(Type type, std::string_view path);