diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.cxx | 18 |
2 files changed, 13 insertions, 9 deletions
@@ -1,3 +1,7 @@ +2007-04-18 Frank Ch. Eigler <fche@elastic.org> + + * parse.cxx (scan_pp): Correct warnings from if/if/else nesting. + 2007-04-10 Martin Hunt <hunt@redhat.com> * stp_check.in: Fixes to make sure debugfs or relayfs are mounted @@ -307,10 +307,10 @@ parser::scan_pp (bool expand_args) { m = scan_pp (result); // NB: recursive if (m == 0) - if (have_token) - throw parse_error ("incomplete conditional - missing %: or %)", t); - else - throw parse_error ("missing THEN tokens for conditional", t); + throw parse_error (have_token ? + "incomplete conditional - missing %: or %)" : + "missing THEN tokens for conditional", + t); have_token = true; if (m->type == tok_operator && (m->content == "%:" || // ELSE @@ -332,11 +332,11 @@ parser::scan_pp (bool expand_args) { m = scan_pp (expand_args && !result); // NB: recursive if (m == 0) - if (have_token) - throw parse_error ("incomplete conditional - missing %)", t); - else - throw parse_error ("missing ELSE tokens for conditional", t); - + throw parse_error (have_token ? + "incomplete conditional - missing %)" : + "missing ELSE tokens for conditional", + t); + have_token = true; if (m->type == tok_operator && m->content == "%)") // END break; |