From ea39b7751e5cee47a674d99d0efbc713a1c3273e Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 27 Apr 2020 19:52:38 +0800 Subject: Ensure that apply directives have an argument The directive `apply account` and similar directives (fixed, year...) require an argument. Ensure that an argument is given. Fixes #553 Fixes #1854 --- src/textual.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/textual.cc') diff --git a/src/textual.cc b/src/textual.cc index 16054445..1c476532 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -810,6 +810,8 @@ void instance_t::apply_directive(char * line) { char * b = next_element(line); string keyword(line); + if (! b) + throw_(parse_error, _f("Directive 'apply %1%' requires an argument") % keyword); if (keyword == "account") apply_account_directive(b); else if (keyword == "tag") -- cgit v1.2.3