Skip to content

Commit 75bba75

Browse files
tkfstevengj
authored andcommitted
Fix findfirst usage for Julia 1.0 (#661)
1 parent 598252b commit 75bba75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/startup.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ else
5454
(Ptr{Cvoid}, Ptr{UInt16}, UInt32),
5555
libpy_handle, pathbuf, length(pathbuf))
5656
@assert ret != 0
57-
libname = String(Base.transcode(UInt8, pathbuf[1:findfirst(pathbuf, 0)-1]))
57+
pathlen = something(findfirst(iszero, pathbuf)) - 1
58+
libname = String(Base.transcode(UInt8, pathbuf[1:pathlen]))
5859
if (Libdl.dlopen_e(libname) != C_NULL)
5960
const libpython = libname
6061
else

0 commit comments

Comments
 (0)