From 3f99432cc11977a4345c881bed3aa60a1a614238 Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 8 Aug 2007 03:36:25 +0000 Subject: 2007-08-07 Frank Ch. Eigler PR 4846 * parse.cxx (input_put): New function, sort of like stdio ungetc. (input_get): Skip cursor position changing for input_put strings. (scan): Rework $.../@... substitution into character pasting. * parse.h: Corresponding changes. * util.h (lex_cast_qstring): Octal-quote unprintable characters. * stap.1.in, NEWS: Document new behaviour. 2007-08-07 Frank Ch. Eigler PR 4846 * parseko/preprocess13.stp, parseok/nineteen.stp, semok/twentyfive.stp: New tests. --- util.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index a076a1a3..f9c298ec 100644 --- a/util.h +++ b/util.h @@ -3,7 +3,7 @@ #include #include #include - +#include const char *get_home_directory(void); int copy_file(const char *src, const char *dest); @@ -65,9 +65,22 @@ lex_cast_qstring(IN const & in) out2 += '"'; for (unsigned i=0; i> 6) & 0x07]; + out2 += "01234567" [(c >> 3) & 0x07]; + out2 += "01234567" [(c >> 0) & 0x07]; + } + else if (c == '"' || c == '\\') + { + out2 += '\\'; + out2 += c; + } + else + out2 += c; } out2 += '"'; return out2; -- cgit