aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--main.c3
-rw-r--r--profile.c5
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 75e86d7a..53f2f171 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/main.c b/main.c
index 9ea76cdf..7438ee3a 100644
--- a/main.c
+++ b/main.c
@@ -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);
diff --git a/profile.c b/profile.c
index 435cad18..391136d2 100644
--- a/profile.c
+++ b/profile.c
@@ -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++ = '\\';