Skip to content

Commit

Permalink
Fix detection of .nl extension (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
frapac authored Oct 2, 2024
1 parent eb5082f commit 94d2fdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ampl_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mutable struct AmplModel <: AbstractNLPModel{Float64, Vector{Float64}}

# check that stub or stub.nl exists
fname = basename(stub)
ext = occursin(".", fname) ? split(fname, '.')[2] : ""
ext = occursin(".", fname) ? split(fname, '.')[end] : ""
if ext == "nl"
isfile(stub) || throw(AmplException("cannot find $(stub)"))
else
Expand Down

0 comments on commit 94d2fdf

Please sign in to comment.