Skip to content

Commit 06b4142

Browse files
authored
Fix typo in initdefs that would lead to a undefvarerror (#54770)
1 parent 807055a commit 06b4142

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

base/client.jl

-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ function incomplete_tag(ex::Expr)
226226
end
227227
incomplete_tag(exc::Meta.ParseError) = incomplete_tag(exc.detail)
228228

229-
cmd_suppresses_program(cmd) = cmd in ('e', 'E')
230229
function exec_options(opts)
231230
startup = (opts.startupfile != 2)
232231
global have_color = colored_text(opts)

base/initdefs.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ function init_active_project()
269269
end
270270

271271
## load path expansion: turn LOAD_PATH entries into concrete paths ##
272+
cmd_suppresses_program(cmd) = cmd in ('e', 'E')
272273

273274
function load_path_expand(env::AbstractString)::Union{String, Nothing}
274275
# named environment?
@@ -283,8 +284,8 @@ function load_path_expand(env::AbstractString)::Union{String, Nothing}
283284
if @isdefined(PROGRAM_FILE)
284285
dir = dirname(PROGRAM_FILE)
285286
else
286-
cmds = unsafe_load_commands(opts.commands)
287-
if any((cmd, arg)->cmd_suppresses_program(cmd), cmds)
287+
cmds = unsafe_load_commands(JLOptions().commands)
288+
if any(cmd::Pair{Char, String}->cmd_suppresses_program(first(cmd)), cmds)
288289
# Usage error. The user did not pass a script.
289290
return nothing
290291
end

0 commit comments

Comments
 (0)