]> Cypherpunks repositories - gostls13.git/commit
os: fix findOneDriveDir to expand strings that contain environment variables
authorDaniela Petruzalek <daniela.petruzalek@gmail.com>
Wed, 4 Jan 2023 15:26:03 +0000 (15:26 +0000)
committerGopher Robot <gobot@golang.org>
Sat, 28 Jan 2023 18:50:46 +0000 (18:50 +0000)
commit1eb37facdd20f28666363057dd51459aa6dd44a7
tree64805c3e51cd5156321ef19900225f117bffdffa
parent1e12c63aacce3749c4fb649477f9b44f74ebf550
os: fix findOneDriveDir to expand strings that contain environment variables

On Windows the registry data type REG_EXPAND_SZ indicates that the string requires expansion
of environment variables. The existing implementation doesn't take that into consideration
and just returns the unexpanded string, ignoring the registry type. This implementation ensures
that environment variables are properly expanded when needed.

Fixes #57576

Change-Id: Ia02c1b05a4cf6eaaffb3be88ce1c9ee100db250f
Reviewed-on: https://go-review.googlesource.com/c/go/+/460535
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/os/os_windows_test.go