Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
88f08c07
Commit
88f08c07
authored
Sep 11, 2018
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated go-paths-helper lib
parent
390235e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
Gopkg.lock
Gopkg.lock
+2
-2
vendor/github.com/arduino/go-paths-helper/paths.go
vendor/github.com/arduino/go-paths-helper/paths.go
+2
-2
No files found.
Gopkg.lock
View file @
88f08c07
...
...
@@ -30,11 +30,11 @@
[[projects]]
branch = "master"
digest = "1:
5c252a193aaa1c0306a7465d11022653dab30d36c3ab5e1e47bd3d608659f061
"
digest = "1:
fd2ebfc02b6ad10599b226d2c0265f160e95e7c80e23f01dcf34a8aff0de98c9
"
name = "github.com/arduino/go-paths-helper"
packages = ["."]
pruneopts = "UT"
revision = "
44d19052dd968f9ee7c3cc26043b81752794a6dd
"
revision = "
751652ddd9f0a98650e681673c2c73937002e889
"
[[projects]]
branch = "master"
...
...
vendor/github.com/arduino/go-paths-helper/paths.go
View file @
88f08c07
...
...
@@ -167,11 +167,11 @@ func (p *Path) Clean() *Path {
// IsInsideDir returns true if the current path is inside the provided
// dir
func
(
p
*
Path
)
IsInsideDir
(
dir
*
Path
)
(
bool
,
error
)
{
rel
,
err
:=
filepath
.
Rel
(
p
.
path
,
dir
.
path
)
rel
,
err
:=
filepath
.
Rel
(
dir
.
path
,
p
.
path
)
if
err
!=
nil
{
return
false
,
err
}
return
strings
.
Contains
(
rel
,
".."
+
string
(
os
.
PathSeparator
))
||
rel
==
".
."
,
nil
return
!
strings
.
Contains
(
rel
,
".."
+
string
(
os
.
PathSeparator
))
&&
rel
!=
".."
&&
rel
!=
"
."
,
nil
}
// Parent returns all but the last element of path, typically the path's
...
...
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