diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | translate.cxx | 9 |
2 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,7 @@ +2005-09-04 Frank Ch. Eigler <fche@elastic.org> + + * translate.cxx (visit_literal_string): \-prefix double-quotes. + 2005-09-04 Martin Hunt <hunt@redhat.com> * testsuite/buildok/context_test.stp: New test. diff --git a/translate.cxx b/translate.cxx index 4b2960f4..c3412cda 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1640,7 +1640,14 @@ c_unparser::visit_continue_statement (continue_statement* s) void c_unparser::visit_literal_string (literal_string* e) { - o->line() << '"' << e->value << '"'; // XXX: escape special chars + const string& v = e->value; + o->line() << '"'; + for (unsigned i=0; i<v.size(); i++) + if (v[i] == '"') // or other escapeworthy characters? + o->line() << '\\' << '"'; + else + o->line() << v[i]; + o->line() << '"'; } |