diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-03-16 15:40:45 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-03-16 18:07:33 +0100 |
commit | c69dea587f1b15eaa57f70d51ce50e5ad481e978 (patch) | |
tree | 0bfa1ff328107cbcc9bbdcbd149a75a69c580c81 | |
parent | 17cc196bd4ac2d24b0ea3ceb5b53f2f31c6f0766 (diff) | |
download | sciteco-c69dea587f1b15eaa57f70d51ce50e5ad481e978.tar.gz |
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
-rw-r--r-- | src/parser.cpp | 12 |
1 files 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; |