Repository navigation
Conversation
|
Thanks - the NULL check is correct and needed. In MUI, MUIA_Application_Commands is optional (every application already has MUI's built-in commands), so a NULL table is a valid state and dereferencing it was a real crash. Setting rm_Result1 = RC_ERROR before the loop, and letting a match overwrite it, fixes that. The test syntax-checks cleanly for pc-x86_64 (only a const-qualifier warning on CreateRexxMsg()); I have not run it. The unknown-command path should call MUIA_Application_RexxHook This is the branch MUI uses for MUIA_Application_RexxHook. From the MUI autodoc:
Zune stores the hook but never calls it (application.c:153 says "stored; not invoked"). With this PR, an application that handles its commands in a RexxHook gets RC_ERROR for everything on Zune, where MUI would run its hook. Since this PR is changing exactly that fallback, could it also:
Other differences from MUI in the same code (fine as follow-ups)
I'd be happy to merge the crash fix, but since the PR is about how unknown commands are answered, I'd like the RexxHook fallback included so the behaviour matches MUI. |
An application with MUIA_Application_UseRexx but no MUIA_Application_Commands has a NULL command table; an ARexx message to its port dereferenced it. Walk the table only when there is one. A command the table does not have goes to MUIA_Application_RexxHook, which Zune stored but never called: the hook gets the application and the RexxMsg, its return value is the result code, and a string set through MUIA_Application_RexxString is the secondary result, as for a table command. Without a hook the message is answered with RC_ERROR. The test developer/debug/test/Zune/rexxunknown sends such an application a command, once without a hook and once with one, and checks the replies.
8e46b41 to
61b5605
Compare
|
Done, rebased on master, still one commit. When no table entry matches and The test has the second case: an application with a RexxHook and no table, The other differences from MUI you list (UseRexx default, QUIT, MC_TEMPLATE_ID, whole-name matching, rm_Result2 on a non-zero rc, clearing RexxString) I will take as a follow-up once this is in. |
|
An application with MUIA_Application_UseRexx but no MUIA_Application_Commands has a NULL command table; an ARexx message to its port dereferenced it. Walk the table only when there is one.
A command the table does not have goes to MUIA_Application_RexxHook, which Zune stored but never called: the hook gets the application and the RexxMsg (A2, A1), its return value is the result code, and a string set through MUIA_Application_RexxString is the secondary result, as for a table command. Without a hook the message is answered with RC_ERROR.
Test: developer/debug/test/Zune/rexxunknown sends such an application a command, once without a hook (RC_ERROR) and once with a RexxHook (called once with the command, its return value and result string come back). pc-x86_64 in QEMU on master 33e67a1: 7 PASS,
REXXUNKNOWN PASS.