]> Cypherpunks repositories - gostls13.git/commit
path/filepath, os/exec: unquote PATH elements on Windows
authorPéter Surányi <speter.go1@gmail.com>
Wed, 20 Feb 2013 05:19:52 +0000 (16:19 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Wed, 20 Feb 2013 05:19:52 +0000 (16:19 +1100)
commitb4109f801a2b51978e1ddc1918a4558a8d8ba36c
tree7942302d167e708a2dac7991e43cb71726790925
parente378aef1def490cec4b86e2d341a287b5286d01f
path/filepath, os/exec: unquote PATH elements on Windows

On Windows, directory names in PATH can be fully or partially quoted
in double quotes ('"'), but the path names as used by most APIs must
be unquoted. In addition, quoted names can contain the semicolon
(';') character, which is otherwise used as ListSeparator.

This CL changes SplitList in path/filepath and LookPath in os/exec
to only treat unquoted semicolons as separators, and to unquote the
separated elements.

(In addition, fix harmless test bug I introduced for LookPath on Unix.)

Related discussion thread:
https://groups.google.com/d/msg/golang-nuts/PXCr10DsRb4/sawZBM7scYgJ

R=rsc, minux.ma, mccoyst, alex.brainman, iant
CC=golang-dev
https://golang.org/cl/7181047
src/pkg/os/exec/lp_unix_test.go
src/pkg/os/exec/lp_windows.go
src/pkg/path/filepath/path.go
src/pkg/path/filepath/path_plan9.go
src/pkg/path/filepath/path_test.go
src/pkg/path/filepath/path_unix.go
src/pkg/path/filepath/path_windows.go
src/pkg/path/filepath/path_windows_test.go [new file with mode: 0644]