Skip to content

Commit

Permalink
length check
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Nov 22, 2024
1 parent 317a9a5 commit 75a6324
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MadsIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,9 @@ function fixlinks(dir::AbstractString="."; test::Bool=true, verbose::Bool=false)
if islink(f)
verbose && println("Checking Link: $(f)")
link = readlink(f)
if !isfile(link)
if length(link) < 256 && isascii(link) && isfile(link)
printstyled("Link of `$(f)` to `$(link)` is OK\n"; color=:green)
else
printstyled("Link `$(f)` needs to be fixed: `$(link)` does not exist!\n"; color=:red)
link_win = Sys.iswindows() ? replace(fn, "/"=>"\\") : link
if isfile(link_win)
Expand All @@ -1907,8 +1909,6 @@ function fixlinks(dir::AbstractString="."; test::Bool=true, verbose::Bool=false)
printstyled("Link needs to be fixed: `$(link_win)` to `$(fn)`\n"; color=:yellow)
end
end
else
printstyled("Link of `$(f)` to `$(link)` is OK\n"; color=:green)
end
elseif isfile(f)
verbose && println("Checking File: $(f)")
Expand Down

0 comments on commit 75a6324

Please sign in to comment.