Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

info script: recurse up until the innermost fileObj is found, if any #268

Closed
wants to merge 1 commit into from

Conversation

jorge-leon
Copy link

If info script is wrapped into a proc, and the proc is then called from inside a sourced script, the fileObj for the script is not found.

Reproduce:

rename info jimsh::info
proc info {command args} {jimsh::info $command {*}$args}
source test.tcl

test.tcl:

puts [jimsh::info script]
puts [info script]

Expected result is:

test.tcl
test.tcl

Result is:

test.tcl

This PR tries to solve the problem by going up the evalFrame until either finding a fileObj or reaching the topEvalFrame and works for the test. However I'm unfamiliar with the jimsh code base and just guessing. Please apologize any style flaws.

@msteveb
Copy link
Owner

msteveb commented Jul 9, 2023

Thanks for the report. In fact info script is almost entirely wrong :-(

I fixed it a different way. See #269 and let me know if you're happy with that.

@msteveb msteveb closed this in 7615825 Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants