From c69dea587f1b15eaa57f70d51ce50e5ad481e978 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 16 Mar 2013 15:40:45 +0100 Subject: make success/failure conditional tests more consistent with the definition of success/failure booleans * for the S and T conditions, nothing changes effectively (were testing for < 0 already) * the F and U conditions were testing for equality to zero which worked for condition booleans returned by commands but not for any failure condition (defined as >= 0) * may be different in classic TECOs but makes more sense IMHO --- src/parser.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 344920f..80bd3b5 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1497,9 +1497,17 @@ StateCondCommand::custom(gchar chr) throw (Error) BEGIN_EXEC(&States::start); result = g_ascii_isdigit((gchar)value); break; - case 'E': + case 'S': + case 'T': + BEGIN_EXEC(&States::start); + result = IS_SUCCESS(value); + break; case 'F': case 'U': + BEGIN_EXEC(&States::start); + result = IS_FAILURE(value); + break; + case 'E': case '=': BEGIN_EXEC(&States::start); result = value == 0; @@ -1510,8 +1518,6 @@ StateCondCommand::custom(gchar chr) throw (Error) result = value > 0; break; case 'L': - case 'S': - case 'T': case '<': BEGIN_EXEC(&States::start); result = value < 0; -- cgit v1.2.3