Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
bcdafaa5
Commit
bcdafaa5
authored
Apr 03, 2012
by
Shenghou Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5c, 6c, 8c: take GOROOT_FINAL into consideration
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5936050
parent
6af069f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
0 deletions
+93
-0
swt.c
src/cmd/5c/swt.c
+31
-0
swt.c
src/cmd/6c/swt.c
+31
-0
swt.c
src/cmd/8c/swt.c
+31
-0
No files found.
src/cmd/5c/swt.c
View file @
bcdafaa5
...
...
@@ -472,12 +472,38 @@ outhist(Biobuf *b)
char
*
p
,
*
q
,
*
op
,
c
;
Prog
pg
;
int
n
;
char
*
tofree
;
static
int
first
=
1
;
static
char
*
goroot
,
*
goroot_final
;
if
(
first
)
{
// Decide whether we need to rewrite paths from $GOROOT to $GOROOT_FINAL.
first
=
0
;
goroot
=
getenv
(
"GOROOT"
);
goroot_final
=
getenv
(
"GOROOT_FINAL"
);
if
(
goroot
==
nil
)
goroot
=
""
;
if
(
goroot_final
==
nil
)
goroot_final
=
goroot
;
if
(
strcmp
(
goroot
,
goroot_final
)
==
0
)
{
goroot
=
nil
;
goroot_final
=
nil
;
}
}
tofree
=
nil
;
pg
=
zprog
;
pg
.
as
=
AHISTORY
;
c
=
pathchar
();
for
(
h
=
hist
;
h
!=
H
;
h
=
h
->
link
)
{
p
=
h
->
name
;
if
(
p
!=
nil
&&
goroot
!=
nil
)
{
n
=
strlen
(
goroot
);
if
(
strncmp
(
p
,
goroot
,
strlen
(
goroot
))
==
0
&&
p
[
n
]
==
'/'
)
{
tofree
=
smprint
(
"%s%s"
,
goroot_final
,
p
+
n
);
p
=
tofree
;
}
}
op
=
0
;
if
(
systemtype
(
Windows
)
&&
p
&&
p
[
1
]
==
':'
){
c
=
p
[
2
];
...
...
@@ -525,6 +551,11 @@ outhist(Biobuf *b)
pg
.
to
.
type
=
D_CONST
;
zwrite
(
b
,
&
pg
,
0
,
0
);
if
(
tofree
)
{
free
(
tofree
);
tofree
=
nil
;
}
}
}
...
...
src/cmd/6c/swt.c
View file @
bcdafaa5
...
...
@@ -339,12 +339,38 @@ outhist(Biobuf *b)
char
*
p
,
*
q
,
*
op
,
c
;
Prog
pg
;
int
n
;
char
*
tofree
;
static
int
first
=
1
;
static
char
*
goroot
,
*
goroot_final
;
if
(
first
)
{
// Decide whether we need to rewrite paths from $GOROOT to $GOROOT_FINAL.
first
=
0
;
goroot
=
getenv
(
"GOROOT"
);
goroot_final
=
getenv
(
"GOROOT_FINAL"
);
if
(
goroot
==
nil
)
goroot
=
""
;
if
(
goroot_final
==
nil
)
goroot_final
=
goroot
;
if
(
strcmp
(
goroot
,
goroot_final
)
==
0
)
{
goroot
=
nil
;
goroot_final
=
nil
;
}
}
tofree
=
nil
;
pg
=
zprog
;
pg
.
as
=
AHISTORY
;
c
=
pathchar
();
for
(
h
=
hist
;
h
!=
H
;
h
=
h
->
link
)
{
p
=
h
->
name
;
if
(
p
!=
nil
&&
goroot
!=
nil
)
{
n
=
strlen
(
goroot
);
if
(
strncmp
(
p
,
goroot
,
strlen
(
goroot
))
==
0
&&
p
[
n
]
==
'/'
)
{
tofree
=
smprint
(
"%s%s"
,
goroot_final
,
p
+
n
);
p
=
tofree
;
}
}
op
=
0
;
if
(
systemtype
(
Windows
)
&&
p
&&
p
[
1
]
==
':'
){
c
=
p
[
2
];
...
...
@@ -400,6 +426,11 @@ outhist(Biobuf *b)
Bputc
(
b
,
pg
.
lineno
>>
24
);
zaddr
(
b
,
&
pg
.
from
,
0
);
zaddr
(
b
,
&
pg
.
to
,
0
);
if
(
tofree
)
{
free
(
tofree
);
tofree
=
nil
;
}
}
}
...
...
src/cmd/8c/swt.c
View file @
bcdafaa5
...
...
@@ -343,12 +343,38 @@ outhist(Biobuf *b)
char
*
p
,
*
q
,
*
op
,
c
;
Prog
pg
;
int
n
;
char
*
tofree
;
static
int
first
=
1
;
static
char
*
goroot
,
*
goroot_final
;
if
(
first
)
{
// Decide whether we need to rewrite paths from $GOROOT to $GOROOT_FINAL.
first
=
0
;
goroot
=
getenv
(
"GOROOT"
);
goroot_final
=
getenv
(
"GOROOT_FINAL"
);
if
(
goroot
==
nil
)
goroot
=
""
;
if
(
goroot_final
==
nil
)
goroot_final
=
goroot
;
if
(
strcmp
(
goroot
,
goroot_final
)
==
0
)
{
goroot
=
nil
;
goroot_final
=
nil
;
}
}
tofree
=
nil
;
pg
=
zprog
;
pg
.
as
=
AHISTORY
;
c
=
pathchar
();
for
(
h
=
hist
;
h
!=
H
;
h
=
h
->
link
)
{
p
=
h
->
name
;
if
(
p
!=
nil
&&
goroot
!=
nil
)
{
n
=
strlen
(
goroot
);
if
(
strncmp
(
p
,
goroot
,
strlen
(
goroot
))
==
0
&&
p
[
n
]
==
'/'
)
{
tofree
=
smprint
(
"%s%s"
,
goroot_final
,
p
+
n
);
p
=
tofree
;
}
}
op
=
0
;
if
(
systemtype
(
Windows
)
&&
p
&&
p
[
1
]
==
':'
){
c
=
p
[
2
];
...
...
@@ -404,6 +430,11 @@ outhist(Biobuf *b)
Bputc
(
b
,
pg
.
lineno
>>
24
);
zaddr
(
b
,
&
pg
.
from
,
0
);
zaddr
(
b
,
&
pg
.
to
,
0
);
if
(
tofree
)
{
free
(
tofree
);
tofree
=
nil
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment