mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
util: fix parseEnv incorrectly splitting multiple ‘=‘ in value
Previously, parseEnv would create multiple environment variables if a single line contained multiple ‘=‘ characters (e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }). This commit ensures that only the first ‘=‘ is used as the key-value delimiter, and the rest of the line is treated as the value. Fixes: https://github.com/nodejs/node/issues/57411 PR-URL: https://github.com/nodejs/node/pull/57421 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
74722a55a6
commit
e6a0d77d57
5 changed files with 38 additions and 8 deletions
|
@ -6,6 +6,8 @@ BASIC=basic
|
|||
|
||||
# previous line intentionally left blank
|
||||
AFTER_LINE=after_line
|
||||
A="B=C"
|
||||
B=C=D
|
||||
EMPTY=
|
||||
EMPTY_SINGLE_QUOTES=''
|
||||
EMPTY_DOUBLE_QUOTES=""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue