mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 01:05:08 +00:00
Shell: Search for variables in the last frame first
Otherwise, we'll end up overwriting another frame's variables if the names match up.
This commit is contained in:
parent
bedad383b5
commit
e87e580eb3
1 changed files with 2 additions and 1 deletions
|
@ -359,7 +359,8 @@ String Shell::resolve_path(String path) const
|
|||
|
||||
Shell::LocalFrame* Shell::find_frame_containing_local_variable(const String& name)
|
||||
{
|
||||
for (auto& frame : m_local_frames) {
|
||||
for (size_t i = m_local_frames.size(); i > 0; --i) {
|
||||
auto& frame = m_local_frames[i - 1];
|
||||
if (frame.local_variables.contains(name))
|
||||
return &frame;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue