From 372790a489fc40014cc37950f707f7e689dad744 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 12 May 2013 17:32:46 +0200 Subject: [PATCH] bin: Ignore empty lines on input. * src/bin/common_finput.cc: Here. * src/ltltest/ltlfilt.test: Test it. * NEWS: Mention it. --- NEWS | 2 ++ src/bin/common_finput.cc | 7 ++++--- src/ltltest/ltlfilt.test | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 4e401787a..1c92839bd 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,8 @@ New in spot 1.1a (not yet released): - genltl --gh-r generated the wrong formulas due to a typo. - ltlfilt --eventual and --universal were not handled properly. - ltlfilt --stutter-invariant would trigger an assert on PSL formulas. + - ltl2tgba, ltl2tgta, ltlcross, and ltlfilt, would all choke on empty + lines in a file of formulas. They now ignore empty lines. New in spot 1.1 (2013-04-28): diff --git a/src/bin/common_finput.cc b/src/bin/common_finput.cc index 711bcd57f..decf96fff 100644 --- a/src/bin/common_finput.cc +++ b/src/bin/common_finput.cc @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2012 Laboratoire de Recherche et Développement de -// l'Epita (LRDE). +// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement +// de l'Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -114,7 +114,8 @@ job_processor::process_stream(std::istream& is, int linenum = 0; std::string line; while (!abort_run && std::getline(is, line)) - error |= process_string(line, filename, ++linenum); + if (!line.empty()) + error |= process_string(line, filename, ++linenum); return error; } diff --git a/src/ltltest/ltlfilt.test b/src/ltltest/ltlfilt.test index a3b346c1e..5e5ad3e95 100755 --- a/src/ltltest/ltlfilt.test +++ b/src/ltltest/ltlfilt.test @@ -31,10 +31,12 @@ checkopt() diff exp out } - +# The empty lines in the file are meant, we want to make sure that +# they are ignored. cat >formulas <