diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | profile.c | 5 |
3 files changed, 14 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2013-05-28 Arnold D. Robbins <arnold@skeeve.com> + + * main.c (main): Add minor hack to not run code if pretty printing + and undocumented env var GAWK_NO_PP_RUN exists. + * profile.c (pp_string): Explicitly print NUL chars as \000. + 2013-05-27 Arnold D. Robbins <arnold@skeeve.com> * configure.ac (AM_INIT_AUTOMAKE): Add dist-lzip to quiet @@ -722,6 +722,9 @@ out: if (do_debug) debug_prog(code_block); + else if (do_pretty_print && ! do_debug && getenv("GAWK_NO_PP_RUN") != NULL) + /* hack to run pretty printer only. need a better solution */ + ; else interpret(code_block); @@ -1196,6 +1196,11 @@ pp_string(const char *in_str, size_t len, int delim) if (delim != '/' && *str == delim) { *obufout++ = '\\'; *obufout++ = delim; + } else if (*str == '\0') { + *obufout++ = '\\'; + *obufout++ = '0'; + *obufout++ = '0'; + *obufout++ = '0'; } else if ((cp = strchr(escapes, *str)) != NULL) { i = cp - escapes; *obufout++ = '\\'; |