Skip to content

Commit

Permalink
Merge pull request #374 from StefanKarpinski/sk/search-bad
Browse files Browse the repository at this point in the history
dep fix: replace search with findfirst
  • Loading branch information
staticfloat authored Aug 7, 2018
2 parents 392a91b + d2216ae commit d7da10f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1096,10 +1096,10 @@ macro load_dependencies(args...)
error("No version of @load_dependencies takes $(length(args)) arguments. See usage instructions!")
end
pkg = ""
r = search(dir,Pkg.Dir.path())
if r != 0:-1
s = search(dir,"/",last(r)+2)
if s != 0:-1
r = findfirst(Pkg.Dir.path(), dir)
if r !== nothing
s = findnext("/", dir, last(r)+2)
if s !== nothing
pkg = dir[(last(r)+2):(first(s)-1)]
else
pkg = dir[(last(r)+2):end]
Expand Down

0 comments on commit d7da10f

Please sign in to comment.