From fa973cba9b4711471f889b339fe2c201f8a0e0fc Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 9 Apr 2021 17:02:34 -0700 Subject: [PATCH] remove non-portable default for $PATH Across the range of platforms Graphviz runs on, this is not a reasonable default. E.g. Windows will have none of these paths and this is not even how one separates paths in Windows $PATH. This is mostly a latent issue, as it is very rare for $PATH to be unset. --- CHANGELOG.md | 4 ++++ lib/ast/pathbin.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 417c97dee..42ac39440 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- $PATH is no longer assumed to be "/bin:/usr/bin:/usr/local/bin" if unset + ## [2.47.1] - 2021-04-17 ### Changed diff --git a/lib/ast/pathbin.c b/lib/ast/pathbin.c index 5e2cefac8..84803d5bf 100644 --- a/lib/ast/pathbin.c +++ b/lib/ast/pathbin.c @@ -21,8 +21,8 @@ char *pathbin(void) { char *bin; - if (!(bin = getenv("PATH")) || !*bin) { - bin = "/bin:/usr/bin:/usr/local/bin"; + if (!(bin = getenv("PATH"))) { + bin = ""; } return bin; } -- 2.40.0