mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
env: remove trailing null-terminator from default path
This commit is contained in:
committed by
Fabian Homborg
parent
2b0b0fe042
commit
f2448e3f0e
@@ -244,7 +244,11 @@ static void setup_path() {
|
||||
// _CS_PATH: colon-separated paths to find POSIX utilities
|
||||
std::string cspath;
|
||||
cspath.resize(confstr(_CS_PATH, nullptr, 0));
|
||||
confstr(_CS_PATH, &cspath[0], cspath.length());
|
||||
if (cspath.length() > 0) {
|
||||
confstr(_CS_PATH, &cspath[0], cspath.length());
|
||||
// remove the trailing null-terminator
|
||||
cspath.resize(cspath.length() - 1);
|
||||
}
|
||||
#else
|
||||
std::string cspath = "/usr/bin:/bin"; // I doubt this is even necessary
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user