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
b22e29d9
Commit
b22e29d9
authored
Mar 18, 2011
by
Yasuhiro Matsumoto
Committed by
Robert Griesemer
Mar 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
godoc: fix path problem for windows.
R=golang-dev, gri CC=golang-dev
https://golang.org/cl/4299044
parent
61c83b64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
dirtrees.go
src/cmd/godoc/dirtrees.go
+4
-4
main.go
src/cmd/godoc/main.go
+3
-0
No files found.
src/cmd/godoc/dirtrees.go
View file @
b22e29d9
...
...
@@ -266,8 +266,8 @@ func (dir *Directory) lookupLocal(name string) *Directory {
// lookup looks for the *Directory for a given path, relative to dir.
func
(
dir
*
Directory
)
lookup
(
path
string
)
*
Directory
{
d
:=
strings
.
Split
(
dir
.
Path
,
"/"
,
-
1
)
p
:=
strings
.
Split
(
path
,
"/"
,
-
1
)
d
:=
strings
.
Split
(
dir
.
Path
,
string
(
filepath
.
Separator
)
,
-
1
)
p
:=
strings
.
Split
(
path
,
string
(
filepath
.
Separator
)
,
-
1
)
i
:=
0
for
i
<
len
(
d
)
{
if
i
>=
len
(
p
)
||
d
[
i
]
!=
p
[
i
]
{
...
...
@@ -342,8 +342,8 @@ func (root *Directory) listing(skipRoot bool) *DirList {
if
strings
.
HasPrefix
(
d
.
Path
,
root
.
Path
)
{
path
=
d
.
Path
[
len
(
root
.
Path
)
:
]
}
// remove trailing
'/'
if any - path must be relative
if
len
(
path
)
>
0
&&
path
[
0
]
==
'/'
{
// remove trailing
separator
if any - path must be relative
if
len
(
path
)
>
0
&&
filepath
.
IsAbs
(
path
)
{
path
=
path
[
1
:
]
}
p
.
Path
=
path
...
...
src/cmd/godoc/main.go
View file @
b22e29d9
...
...
@@ -222,6 +222,9 @@ func main() {
flag
.
Usage
=
usage
flag
.
Parse
()
// Clean goroot: normalize path separator.
*
goroot
=
filepath
.
Clean
(
*
goroot
)
// Check usage: either server and no args, or command line and args
if
(
*
httpAddr
!=
""
)
!=
(
flag
.
NArg
()
==
0
)
{
usage
()
...
...
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