Fix getting path confstr, the returned size includes the zero terminator
Closes #1047
This commit is contained in:
parent
c2305e03b3
commit
0daf7af493
|
@ -25,7 +25,7 @@ ShellManager::ShellManager()
|
|||
// Get a guaranteed to be POSIX shell binary
|
||||
{
|
||||
auto size = confstr(_CS_PATH, 0, 0);
|
||||
String path; path.resize(size, 0);
|
||||
String path; path.resize(size-1, 0);
|
||||
confstr(_CS_PATH, path.data(), size);
|
||||
for (auto dir : StringView{path} | split<StringView>(':'))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user