Menu

#817 [scripting] ScriptingManager::LoadBufferRedirectOutput redirects always to internal print function

Next_Nightly
applied
Patch
2019-04-26
2019-04-23
bluehazzard
No

After finishing work the function ScriptingManager::LoadBufferRedirectOutput will redirect the print output always to the internal ScriptsPrintFunc function. This is wrong, because for example the scripting console redirects the output to itself if it is open.

You can see the behavior if you safe this scrip in a file and run it in the script console:

print(_("You see me in the script console"));
Log(ReplaceMacros(_("[[print(_(\"I will break printing in the script console\"))]])))
print(_("You will NOT see me in the script console"));

The attached patch will fix this by restoring the old print function.

If no comments are made i will commit this tomorrow.

This is also one bug i need to be fixed to can write tests for ticket 520

1 Attachments

Discussion

  • Teodor Petrov

    Teodor Petrov - 2019-04-24

    Why are you calling SquirrelVM::GetVMPtr() multiple times? Call it once and use a variable. Other than that I cannot comment if it is good or bad... So go on and lets see what will break if it breaks. :)

     
  • bluehazzard

    bluehazzard - 2019-04-26
    • status: open --> applied
     
  • bluehazzard

    bluehazzard - 2019-04-26

    Commited in revision: 11658

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.