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

Issue 59580044: code review 59580044: os/exec: fix Command with relative paths (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by bradfitz
Modified:
11 years, 5 months ago
Reviewers:
brainman, iant, adg
CC:
iant, adg, golang-codereviews
Visibility:
Public.

Description

os/exec: fix Command with relative paths Command was (and is) documented like: "If name contains no path separators, Command uses LookPath to resolve the path to a complete name if possible. Otherwise it uses name directly." But that wasn't true. It always did LookPath, and then set a sticky error that the user couldn't unset. And then if cmd.Dir was changed, Start would still fail due to the earlier sticky error being set. This keeps LookPath in the same place as before (so no user visible changes in cmd.Path after Command), but only does it when the documentation says it will happen. Also, clarify the docs about a relative Dir path. No change in any existing behavior, except using Command is now possible with relative paths. Previously it only worked if you built the *Cmd by hand. Fixes Issue 7228

Patch Set 1 #

Patch Set 2 : diff -r ab7e873d13bd https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r ab7e873d13bd https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 033493cdf40e https://go.googlecode.com/hg/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -14 lines) Patch
src/pkg/os/exec/exec.go View 1 5 chunks +26 lines, -14 lines 1 comment Download
src/pkg/os/exec/exec_test.go View 1 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 13
bradfitz
Hello iant (cc: adg, golang-codereviews@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 5 months ago (2014-02-03 20:25:11 UTC) #1
iant
LGTM
11 years, 5 months ago (2014-02-03 21:27:17 UTC) #2
bradfitz
*** Submitted as https://code.google.com/p/go/source/detail?r=bbc5b7a12149 *** os/exec: fix Command with relative paths Command was (and is) ...
11 years, 5 months ago (2014-02-03 21:32:17 UTC) #3
brainman
https://codereview.appspot.com/59580044/diff/40001/src/pkg/os/exec/exec.go File src/pkg/os/exec/exec.go (right): https://codereview.appspot.com/59580044/diff/40001/src/pkg/os/exec/exec.go#newcode124 src/pkg/os/exec/exec.go:124: This won't work on windows. Windows path have both ...
11 years, 5 months ago (2014-02-03 23:43:19 UTC) #4
bradfitz
What doesn't work? I see chunk mismatch now. I think it should work fine on ...
11 years, 5 months ago (2014-02-04 04:05:26 UTC) #5
brainman
On 2014/02/04 04:05:26, bradfitz wrote: > What doesn't work? ... > Like I said earlier, ...
11 years, 5 months ago (2014-02-04 04:59:21 UTC) #6
adg
LGTM
11 years, 5 months ago (2014-02-04 09:55:44 UTC) #7
adg
On 4 February 2014 05:59, <alex.brainman@gmail.com> wrote: > I would just use: > > return ...
11 years, 5 months ago (2014-02-04 09:55:54 UTC) #8
iant
On Mon, Feb 3, 2014 at 8:59 PM, <alex.brainman@gmail.com> wrote: > On 2014/02/04 04:05:26, bradfitz ...
11 years, 5 months ago (2014-02-04 14:19:20 UTC) #9
bradfitz
On Tue, Feb 4, 2014 at 6:19 AM, Ian Lance Taylor <iant@golang.org> wrote: > On ...
11 years, 5 months ago (2014-02-04 16:09:46 UTC) #10
iant
On Tue, Feb 4, 2014 at 8:09 AM, Brad Fitzpatrick <bradfitz@golang.org> wrote: > > On ...
11 years, 5 months ago (2014-02-04 17:28:48 UTC) #11
brainman
Replies to everyone follow ... On 2014/02/04 14:19:20, iant wrote: > ... The code calls ...
11 years, 5 months ago (2014-02-05 06:18:46 UTC) #12
brainman
11 years, 5 months ago (2014-02-06 05:28:31 UTC) #13
Message was sent while issue was closed.
On 2014/02/05 06:18:46, brainman wrote:
> 
> ... I will send a new CL for review.
> 

Please review https://codereview.appspot.com/59740050/

Alex
Sign in to reply to this message.

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