Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
bfdf7951
Commit
bfdf7951
authored
Nov 17, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands2: Use path.Split for path parsing in 'add'
parent
380337b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
core/commands2/add.go
core/commands2/add.go
+2
-4
No files found.
core/commands2/add.go
View file @
bfdf7951
...
...
@@ -5,7 +5,7 @@ import (
"errors"
"fmt"
"io"
"
strings
"
"
path
"
cmds
"github.com/jbenet/go-ipfs/commands"
core
"github.com/jbenet/go-ipfs/core"
...
...
@@ -149,9 +149,7 @@ func addDir(n *core.IpfsNode, dir cmds.File, added *AddOutput) (*dag.Node, error
return
nil
,
err
}
name
:=
file
.
FileName
()
slashIndex
:=
strings
.
LastIndex
(
name
,
"/"
)
name
=
name
[
slashIndex
+
1
:
]
_
,
name
:=
path
.
Split
(
file
.
FileName
())
err
=
tree
.
AddNodeLink
(
name
,
node
)
if
err
!=
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