FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
net/http/cgi: more windows perl test work

Don't rely on finding cmd.exe in a particular spot.

Update issue 4401

Please review this at http://codereview.appspot.com/6842066/

Affected files:
M src/pkg/net/http/cgi/testdata/test.cgi


Index: src/pkg/net/http/cgi/testdata/test.cgi
===================================================================
--- a/src/pkg/net/http/cgi/testdata/test.cgi
+++ b/src/pkg/net/http/cgi/testdata/test.cgi
@@ -50,20 +50,18 @@
print "env-$k=$clean_env\n";
}

-# NOTE: don't call getcwd() for windows.
-# msys return /c/go/src/... not C:\go\...
-my $dir;
+my $dir = getcwd();
if ($^O eq 'MSWin32' || $^O eq 'msys') {
- my $cmd = $ENV{'COMSPEC'} || 'c:\\windows\\system32\\cmd.exe';
- $cmd =~ s!\\!/!g;
- $dir = `$cmd /c cd`;
- chomp $dir;
-} else {
- $dir = getcwd();
+ # msys return /c/go/src/... not C:\go\,
+ # so correct for it.
+ if ($dir =~ s!^/([a-zA-Z])/!!) {
+ $dir = uc($1) . ":\\$dir";
+ $dir =~ s!/!\\!g;
+ }
}
+
print "cwd=$dir\n";

-
# A minimal version of CGI.pm, for people without the perl-modules
# package installed. (CGI.pm used to be part of the Perl core, but
# some distros now bundle perl-base and perl-modules separately...)

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 19, '12 at 5:24p
activeNov 19, '12 at 6:48p
posts7
users2
websitegolang.org

2 users in discussion

Bradfitz: 4 posts Krautz: 3 posts

People

Translate

site design / logo © 2022 Grokbase