summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorfche <fche>2005-09-05 00:12:27 +0000
committerfche <fche>2005-09-05 00:12:27 +0000
commitf86db5a776ed429e0df0e3d871c5692f86b0f4be (patch)
treeba3378b7d2c476fd5ae1494f30b3ae44da8cb057 /translate.cxx
parent6c100036afcfa4d038f7a7af83bcbcb28f905d35 (diff)
downloadsystemtap-steved-f86db5a776ed429e0df0e3d871c5692f86b0f4be.tar.gz
systemtap-steved-f86db5a776ed429e0df0e3d871c5692f86b0f4be.tar.xz
systemtap-steved-f86db5a776ed429e0df0e3d871c5692f86b0f4be.zip
2005-09-04 Frank Ch. Eigler <fche@elastic.org>
* translate.cxx (visit_literal_string): \-prefix double-quotes.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx9
1 files changed, 8 insertions, 1 deletions
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() << '"';
}