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

Delta Between Two Patch Sets: src/pkg/http/cgi/testdata/test.cgi

Issue 4635042: code review 4635042: src/pkg/http/cgi: Handler.Dir for specify working direc... (Closed)
Left Patch Set: diff -r dd3913e4b4b9 http://go.googlecode.com/hg/ Created 13 years, 9 months ago
Right Patch Set: diff -r b295b8bda20b http://go.googlecode.com/hg/ Created 13 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/http/cgi/host_test.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 # Copyright 2011 The Go Authors. All rights reserved. 2 # Copyright 2011 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style 3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file. 4 # license that can be found in the LICENSE file.
5 # 5 #
6 # Test script run as a child process under cgi_test.go 6 # Test script run as a child process under cgi_test.go
7 7
8 use strict; 8 use strict;
9 use CGI; 9 use CGI;
10 use Cwd;
10 11
11 my $q = CGI->new; 12 my $q = CGI->new;
12 my $params = $q->Vars; 13 my $params = $q->Vars;
13 14
14 if ($params->{"loc"}) { 15 if ($params->{"loc"}) {
15 print "Location: $params->{loc}\r\n\r\n"; 16 print "Location: $params->{loc}\r\n\r\n";
16 exit(0); 17 exit(0);
17 } 18 }
18 19
19 my $NL = "\r\n"; 20 my $NL = "\r\n";
(...skipping 12 matching lines...) Expand all
32 33
33 foreach my $k (sort keys %$params) { 34 foreach my $k (sort keys %$params) {
34 print "param-$k=$params->{$k}\n"; 35 print "param-$k=$params->{$k}\n";
35 } 36 }
36 37
37 foreach my $k (sort keys %ENV) { 38 foreach my $k (sort keys %ENV) {
38 my $clean_env = $ENV{$k}; 39 my $clean_env = $ENV{$k};
39 $clean_env =~ s/[\n\r]//g; 40 $clean_env =~ s/[\n\r]//g;
40 print "env-$k=$clean_env\n"; 41 print "env-$k=$clean_env\n";
41 } 42 }
43
44 # NOTE: don't call getcwd() for windows.
45 # msys return /c/go/src/... not C:\go\...
46 my $dir;
47 if ($^O eq 'MSWin32' || $^O eq 'msys') {
48 my $cmd = $ENV{'COMSPEC'} || 'c:\\windows\\system32\\cmd.exe';
49 $cmd =~ s!\\!/!g;
50 $dir = `$cmd /c cd`;
51 chomp $dir;
52 } else {
53 $dir = getcwd();
54 }
55 print "cwd=$dir\n";
LEFTRIGHT

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