Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix]
nvm_strip_path
: Preserve leading/trailing colons
Path lists in environmental variables often give special meaning to empty entries (e.g. in PATH or MANPATH). These are represented by leading or trailing colons, or by doubled colons in the middle of the list. Adjust the awk invocation to correctly deal with trailing colons by printing the separator before every field except the first, and then printing the final separator that is read from the input - this will either be a colon or the null string. This preserves leading and trailing colons in all cases while not adding extra colons in the wrong place. Add test to confirm the correct behaviour. Fixes #3144
- Loading branch information