From: Morgan Deters Date: Sat, 18 Jan 2014 03:59:39 +0000 (-0500) Subject: Fix for quote-escaping in smt2 printer X-Git-Tag: cvc5-1.0.0~6987^2~11 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d0e992bda89926bd3c4ecfd6deefb0db87a71d8a;p=cvc5.git Fix for quote-escaping in smt2 printer --- diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index b743ba70e..4b36b4548 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -960,9 +960,10 @@ static void toStream(std::ostream& out, const CommandUnsupported* s) throw() { static void toStream(std::ostream& out, const CommandFailure* s) throw() { string message = s->getMessage(); // escape all double-quotes - size_t pos; - while((pos = message.find('"')) != string::npos) { + size_t pos = 0; + while((pos = message.find('"', pos)) != string::npos) { message = message.replace(pos, 1, "\\\""); + pos += 2; } out << "(error \"" << message << "\")" << endl; }