Skip to content

Commit e84ecd0

Browse files
committed
check for self-includes
1 parent db3edf4 commit e84ecd0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/module.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ Takes a given Julia source file and another (absolute) path, gives the
125125
line on which the path is included in the file or 0.
126126
"""
127127
function includeline(file::AbstractString, included_file::AbstractString)
128+
# check for self-includes
129+
file == included_file && return 0
130+
128131
i = 0
129132
open(file) do io
130133
for (index, line) in enumerate(eachline(io))

0 commit comments

Comments
 (0)