Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4418)

Issue 7181047: code review 7181047: path/filepath: SplitList shouldn't split quoted paths o... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by speter
Modified:
11 years, 2 months ago
Reviewers:
CC:
rsc, minux1, mccoyst_gmail.com, brainman, iant2, golang-dev
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : diff -r 2da48f86d386 https://code.google.com/p/go #

Patch Set 3 : diff -r 2da48f86d386 https://code.google.com/p/go #

Patch Set 4 : diff -r 0adf91947752 https://code.google.com/p/go #

Patch Set 5 : diff -r 6f23480a76e1 https://code.google.com/p/go #

Patch Set 6 : diff -r bfaaa2075564 https://code.google.com/p/go #

Patch Set 7 : diff -r bfaaa2075564 https://code.google.com/p/go #

Total comments: 26

Patch Set 8 : diff -r af6f2a37a53b https://code.google.com/p/go #

Patch Set 9 : diff -r af6f2a37a53b https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -8 lines) Patch
M src/pkg/os/exec/lp_unix_test.go View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M src/pkg/os/exec/lp_windows.go View 1 2 3 4 5 6 7 8 2 chunks +34 lines, -1 line 0 comments Download
M src/pkg/path/filepath/path.go View 1 2 3 4 5 6 7 1 chunk +1 line, -4 lines 0 comments Download
M src/pkg/path/filepath/path_plan9.go View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M src/pkg/path/filepath/path_test.go View 1 2 3 4 5 1 chunk +28 lines, -2 lines 0 comments Download
M src/pkg/path/filepath/path_unix.go View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M src/pkg/path/filepath/path_windows.go View 1 2 3 4 5 6 7 8 1 chunk +33 lines, -0 lines 0 comments Download
A src/pkg/path/filepath/path_windows_test.go View 1 2 3 4 5 6 7 1 chunk +89 lines, -0 lines 0 comments Download

Messages

Total messages: 26
speter
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 3 months ago (2013-01-22 14:48:15 UTC) #1
rsc
Shouldn't it remove the quotes? I'm a bit skeptical about this. I don't want to ...
11 years, 3 months ago (2013-01-22 19:06:27 UTC) #2
speter
Perhaps a more succinct description of the change would be: "on Windows, only split at ...
11 years, 3 months ago (2013-01-22 23:49:34 UTC) #3
rsc
I certainly expect to be able to use the split path elements directly in constructing ...
11 years, 3 months ago (2013-01-23 02:44:53 UTC) #4
minux1
On Wed, Jan 23, 2013 at 7:49 AM, speter <speter.go1@gmail.com> wrote: > Not fixing splitting ...
11 years, 3 months ago (2013-01-23 11:53:05 UTC) #5
mccoyst_gmail.com
On Wednesday, January 23, 2013 6:52:44 AM UTC-5, minux wrote: > > On Wed, Jan ...
11 years, 3 months ago (2013-01-23 14:23:40 UTC) #6
speter
Sorry, I'm afraid I wasn't clear / specific enough. I agree that returning the "bare" ...
11 years, 3 months ago (2013-01-23 14:43:30 UTC) #7
brainman
On 2013/01/23 14:43:30, speter wrote: > > I agree that returning the "bare" (on Windows, ...
11 years, 2 months ago (2013-01-30 06:34:21 UTC) #8
speter
I believe everyone who has commented on this issue so far agrees that: 1. SplitList ...
11 years, 2 months ago (2013-01-30 13:46:35 UTC) #9
iant2
On Wed, Jan 30, 2013 at 5:46 AM, <speter.go1@gmail.com> wrote: > > Could someone from ...
11 years, 2 months ago (2013-01-30 15:02:27 UTC) #10
rsc
If we're going to change anything on Windows, I believe the correct change is to: ...
11 years, 2 months ago (2013-01-30 16:17:56 UTC) #11
brainman
I can see 3 choices here: 1) We accept this CL as is (means no ...
11 years, 2 months ago (2013-01-31 02:10:00 UTC) #12
rsc
I agree with you: (2) is the right choice. Russ
11 years, 2 months ago (2013-01-31 02:11:06 UTC) #13
speter
Thank you for the comments, and apologies for the delay and the lengthy message -- ...
11 years, 2 months ago (2013-02-05 23:11:50 UTC) #14
speter
As for the quoting rules, I haven't found a definitive source but based on some ...
11 years, 2 months ago (2013-02-05 23:21:21 UTC) #15
brainman
On 2013/02/05 23:11:50, speter wrote: > ... And I've found that LookPath in os/exec also ...
11 years, 2 months ago (2013-02-06 06:35:14 UTC) #16
brainman
On 2013/02/05 23:21:21, speter wrote: > As for the quoting rules, I haven't found a ...
11 years, 2 months ago (2013-02-06 06:39:13 UTC) #17
speter
Please take another look. Sorry for the delay again. Changes from previous version: - updated ...
11 years, 2 months ago (2013-02-17 16:02:30 UTC) #18
minux1
On Mon, Feb 18, 2013 at 12:02 AM, <speter.go1@gmail.com> wrote: > I also created, as ...
11 years, 2 months ago (2013-02-17 16:08:12 UTC) #19
speter
Please take another look. Cleaned up and merged the validation test as path_windows_test.go.
11 years, 2 months ago (2013-02-18 18:03:47 UTC) #20
brainman
Thank you. Most of your changes look good to me. Just test needs bit of ...
11 years, 2 months ago (2013-02-19 01:38:36 UTC) #21
rsc
https://codereview.appspot.com/7181047/diff/33001/src/pkg/path/filepath/path_windows.go File src/pkg/path/filepath/path_windows.go (right): https://codereview.appspot.com/7181047/diff/33001/src/pkg/path/filepath/path_windows.go#newcode86 src/pkg/path/filepath/path_windows.go:86: fp = fp + string(c) This generates a quadratic ...
11 years, 2 months ago (2013-02-19 15:58:10 UTC) #22
speter
Please take another look. https://codereview.appspot.com/7181047/diff/33001/src/pkg/path/filepath/path.go File src/pkg/path/filepath/path.go (right): https://codereview.appspot.com/7181047/diff/33001/src/pkg/path/filepath/path.go#newcode178 src/pkg/path/filepath/path.go:178: // On Windows, directory names ...
11 years, 2 months ago (2013-02-19 17:20:10 UTC) #23
rsc
LGTM Leaving for Alex.
11 years, 2 months ago (2013-02-19 17:22:04 UTC) #24
brainman
LGTM Thank you. Alex
11 years, 2 months ago (2013-02-20 05:19:35 UTC) #25
brainman
11 years, 2 months ago (2013-02-20 05:20:00 UTC) #26
*** Submitted as https://code.google.com/p/go/source/detail?r=16de2fb99862 ***

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://codereview.appspot.com/7181047

Committer: Alex Brainman <alex.brainman@gmail.com>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b