From 38d688ccbe075c8632c186909f76e03cad14bd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 3 Mar 2012 20:05:40 +0100 Subject: [PATCH] BHandler: hopefully fixes a regression introduced in hrev43777. * BHandler scripting handles bad scripting syntax by returning the Messenger property. * Thanks to Siarzhuk Zharski for pointing this out. --- src/kits/app/Handler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/kits/app/Handler.cpp b/src/kits/app/Handler.cpp index e200f97d4c..f7fbb79828 100644 --- a/src/kits/app/Handler.cpp +++ b/src/kits/app/Handler.cpp @@ -222,11 +222,14 @@ BHandler::MessageReceived(BMessage *message) int32 form; const char *prop; - status_t err = message->GetCurrentSpecifier(&cur, &specifier, &form, &prop); - if (err != B_OK) + status_t err = message->GetCurrentSpecifier(&cur, &specifier, + &form, &prop); + if (err != B_OK && err != B_BAD_SCRIPT_SYNTAX) break; bool known = false; - if (cur < 0 || (strcmp(prop, "Messenger") == 0)) { + // B_BAD_SCRIPT_SYNTAX defaults to the Messenger property + if (err == B_BAD_SCRIPT_SYNTAX || cur < 0 + || (strcmp(prop, "Messenger") == 0)) { err = reply.AddMessenger("result", this); known = true; } else if (strcmp(prop, "Suites") == 0) {