MCPcopy Create free account
hub / github.com/AGWA/git-crypt / our_exe_path

Function our_exe_path

util-win32.cpp:112–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112std::string our_exe_path ()
113{
114 std::vector<char> buffer(128);
115 size_t len;
116
117 while ((len = GetModuleFileNameA(nullptr, &buffer[0], buffer.size())) == buffer.size()) {
118 // buffer may have been truncated - grow and try again
119 buffer.resize(buffer.size() * 2);
120 }
121 if (len == 0) {
122 throw System_error("GetModuleFileNameA", "", GetLastError());
123 }
124
125 return std::string(buffer.begin(), buffer.begin() + len);
126}
127
128int exit_status (int status)
129{

Callers

nothing calls this directly

Calls 1

System_errorClass · 0.85

Tested by

no test coverage detected