MCPcopy Create free account
hub / github.com/audacity/audacity / FindXDGOpen

Function FindXDGOpen

libraries/lib-basic-ui/BasicUI.cpp:81–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81std::string FindXDGOpen()
82{
83 const char *path = getenv("PATH");
84
85 if (!path)
86 return {};
87
88 std::string result;
89
90 while (*path) {
91 const char *colon = strchr(path, ':');
92 if (!colon)
93 colon = path + strlen(path);
94
95 result.assign(path, colon);
96 result += "/xdg-open";
97
98 if (access(result.c_str(), X_OK) == 0)
99 return result;
100
101 path = colon;
102
103 if (*path == ':')
104 ++path;
105 }
106
107 return {};
108}
109
110bool RunXDGOpen(const std::string& uri)
111{

Callers 1

RunXDGOpenFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected