From 033534ecf207a1dfe4a476fdc1d69bdab9821712 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 8 May 2018 16:27:39 +0200 Subject: [PATCH] F #1548: Do not require END_VALUE for NEVER fix END_TYPE check --- include/ScheduledAction.h | 1 + src/vm_template/ScheduledAction.cc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/ScheduledAction.h b/include/ScheduledAction.h index f73edb6f12..cc6d69db30 100644 --- a/include/ScheduledAction.h +++ b/include/ScheduledAction.h @@ -38,6 +38,7 @@ public: enum EndOn { + END_NONE = -1, NEVER = 0, TIMES = 1, DATE = 2 diff --git a/src/vm_template/ScheduledAction.cc b/src/vm_template/ScheduledAction.cc index a8d418091c..29d04b067e 100644 --- a/src/vm_template/ScheduledAction.cc +++ b/src/vm_template/ScheduledAction.cc @@ -53,7 +53,7 @@ int SchedAction::repeat(Repeat& r) int SchedAction::endon(EndOn& eo) { - eo = NEVER; + eo = END_NONE; std::string et_s = vector_value("END_TYPE"); @@ -72,7 +72,7 @@ int SchedAction::endon(EndOn& eo) return -1; } - if ( v_eo < TIMES || v_eo > DATE ) + if ( v_eo < NEVER || v_eo > DATE ) { return -1; } @@ -169,7 +169,7 @@ bool SchedAction::ends_in_range(EndOn eo, std::string& error) int end_value; int rc = vector_value("END_VALUE", end_value); - if ( rc == -1 ) + if ( rc == -1 && eo != NEVER ) { error = "Missing END_VALUE"; return false;