From 6c210895997a74edc9ef3c8fdee989cf22623169 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 6 Dec 2013 11:29:31 +0100 Subject: [PATCH] ltlcross: end CSV lines with \n, not \r\n * src/bin/ltlcross.cc (print_stats_csv): Revert the recent addition of \r, it is caussing too many issues. * NEWS: Mention it. --- NEWS | 7 ++++++- src/bin/ltlcross.cc | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 147bc91da..970fab96c 100644 --- a/NEWS +++ b/NEWS @@ -37,7 +37,12 @@ New in spot 1.2a (not released) http://spot.lip6.fr/userdoc/csv.html for some discussion and examples of the last few features. * Bug fixes: - - ltlcross' CSV output now stricly follows RFC 4180. + - ltlcross' CSV output has been changed to be more RFC 4180 + compliant: it no longuer output useless cosmetic spaces, and + use double-quotes with proper escaping for strings. The only + RFC 4180 rule that it does not follow is that it will terminate + lines with \n instead of \r\n because the latter cause issues + with a couple of tools. - ltlcross failed to report missing input or output escape sequences on all but the first configured translator. diff --git a/src/bin/ltlcross.cc b/src/bin/ltlcross.cc index 7866a39a9..137def2ba 100644 --- a/src/bin/ltlcross.cc +++ b/src/bin/ltlcross.cc @@ -1535,18 +1535,18 @@ print_stats_csv(const char* filename) *out << "\"formula\",\"tool\","; statistics::fields(*out, !opt_omit, has_sr); - *out << "\r\n"; + *out << '\n'; for (unsigned r = 0; r < rounds; ++r) for (unsigned t = 0; t < ntrans; ++t) if (!opt_omit || vstats[r][t].ok) { - *out << "\""; + *out << '"'; spot::escape_rfc4180(*out, formulas[r]); *out << "\",\""; spot::escape_rfc4180(*out, translators[t].name); *out << "\","; vstats[r][t].to_csv(*out, !opt_omit, has_sr); - *out << "\r\n"; + *out << '\n'; } delete outfile; }