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

Issue 10594043: code review 10594043: syscall: handle empty environment variable values prope... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by brainman
Modified:
10 years, 9 months ago
Reviewers:
bradfitz
CC:
golang-dev, bradfitz
Visibility:
Public.

Description

syscall: handle empty environment variable values properly on windows Setenv("AN_ENV_VAR", "") deletes AN_ENV_VAR instead of setting it to "" at this moment. Also Getenv("AN_ENV_VAR") returns "not found", if AN_ENV_VAR is "". Change it, so they behave like unix. Fixes issue 5610

Patch Set 1 #

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

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

Total comments: 6

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -10 lines) Patch
M src/pkg/syscall/env_windows.go View 1 1 chunk +3 lines, -10 lines 0 comments Download
A src/pkg/syscall/syscall_test.go View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download

Messages

Total messages: 3
brainman
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
10 years, 9 months ago (2013-06-26 07:12:53 UTC) #1
bradfitz
LGTM after nits https://codereview.appspot.com/10594043/diff/6001/src/pkg/syscall/syscall_test.go File src/pkg/syscall/syscall_test.go (right): https://codereview.appspot.com/10594043/diff/6001/src/pkg/syscall/syscall_test.go#newcode15 src/pkg/syscall/syscall_test.go:15: t.Fatalf("Setenv failed: %v", err) failed to ...
10 years, 9 months ago (2013-06-26 15:27:55 UTC) #2
brainman
10 years, 9 months ago (2013-06-27 00:11:38 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=afb7b199f074 ***

syscall: handle empty environment variable values properly on windows

Setenv("AN_ENV_VAR", "") deletes AN_ENV_VAR instead of setting it
to "" at this moment. Also Getenv("AN_ENV_VAR") returns "not found",
if AN_ENV_VAR is "". Change it, so they behave like unix.

Fixes issue 5610

R=golang-dev, bradfitz
CC=golang-dev
https://codereview.appspot.com/10594043

https://codereview.appspot.com/10594043/diff/6001/src/pkg/syscall/syscall_tes...
File src/pkg/syscall/syscall_test.go (right):

https://codereview.appspot.com/10594043/diff/6001/src/pkg/syscall/syscall_tes...
src/pkg/syscall/syscall_test.go:15: t.Fatalf("Setenv failed: %v", err)
On 2013/06/26 15:27:55, bradfitz wrote:
> failed to set %q: %v", value, err

Done.

https://codereview.appspot.com/10594043/diff/6001/src/pkg/syscall/syscall_tes...
src/pkg/syscall/syscall_test.go:19: t.Fatalf("Getenv failed to find %v
variable", key)
On 2013/06/26 15:27:55, bradfitz wrote:
> to find %v variable (want value %q)", key, value

Done.

https://codereview.appspot.com/10594043/diff/6001/src/pkg/syscall/syscall_tes...
src/pkg/syscall/syscall_test.go:22: t.Fatalf("Getenv returns wrong %v variable
value of %q", key, newvalue)
On 2013/06/26 15:27:55, bradfitz wrote:
> "Getenv(%v) = %q; want %q", key, newValue, value

Done.
Sign in to reply to this message.

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