diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2017-03-04 21:53:33 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2017-03-04 23:40:05 +0000 |
commit | 1b37ac39f7980e3dfe59521c23e8893a64064632 (patch) | |
tree | ba685384d7d41cf3221ade0cebabe3a7f47bc312 /src | |
parent | 768e8b5bdaa5565979268013fa1cba6800174d94 (diff) |
Debug: Use UTF-8 linedrawing rather than ASCII lineart for grouping expansion tracing messages
Diffstat (limited to 'src')
-rw-r--r-- | src/src/expand.c | 41 | ||||
-rw-r--r-- | src/src/macros.h | 8 |
2 files changed, 39 insertions, 10 deletions
diff --git a/src/src/expand.c b/src/src/expand.c index 1da858997..b96b2897a 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -3872,7 +3872,11 @@ BOOL resetok = TRUE; expand_level++; DEBUG(D_expand) - debug_printf_indent("/%s: %s\n", skipping ? " scanning" : "considering", string); + debug_printf_indent(UTF8_DOWN_RIGHT "%s: %s\n", + skipping + ? UTF8_HORIZ UTF8_HORIZ UTF8_HORIZ "scanning" + : "considering", + string); expand_string_forcedfail = FALSE; expand_string_message = US""; @@ -4119,8 +4123,13 @@ while (*s != 0) DEBUG(D_expand) { - debug_printf_indent("|__condition: %.*s\n", (int)(next_s - s), s); - debug_printf_indent("|_____result: %s\n", cond ? "true" : "false"); + debug_printf_indent(UTF8_VERT_RIGHT UTF8_HORIZ UTF8_HORIZ + "condition: %.*s\n", + (int)(next_s - s), s); + debug_printf_indent(UTF8_VERT_RIGHT UTF8_HORIZ UTF8_HORIZ + UTF8_HORIZ UTF8_HORIZ UTF8_HORIZ + "result: %s\n", + cond ? "true" : "false"); } s = next_s; @@ -7501,9 +7510,17 @@ else if (resetok_p) *resetok_p = FALSE; DEBUG(D_expand) { - debug_printf_indent("|__expanding: %.*s\n", (int)(s - string), string); - debug_printf_indent("%s_____result: %s\n", skipping ? "|" : "\\", yield); - if (skipping) debug_printf_indent("\\___skipping: result is not used\n"); + debug_printf_indent(UTF8_VERT_RIGHT UTF8_HORIZ UTF8_HORIZ + "expanding: %.*s\n", + (int)(s - string), string); + debug_printf_indent("%s" + UTF8_HORIZ UTF8_HORIZ UTF8_HORIZ UTF8_HORIZ UTF8_HORIZ + "result: %s\n", + skipping ? UTF8_VERT_RIGHT : UTF8_UP_RIGHT, + yield); + if (skipping) + debug_printf_indent(UTF8_UP_RIGHT UTF8_HORIZ UTF8_HORIZ UTF8_HORIZ + "skipping: result is not used\n"); } expand_level--; return yield; @@ -7527,10 +7544,14 @@ EXPAND_FAILED: if (left != NULL) *left = s; DEBUG(D_expand) { - debug_printf_indent("|failed to expand: %s\n", string); - debug_printf_indent("%s___error message: %s\n", - expand_string_forcedfail ? "|" : "\\", expand_string_message); - if (expand_string_forcedfail) debug_printf_indent("\\failure was forced\n"); + debug_printf_indent(UTF8_VERT_RIGHT "failed to expand: %s\n", + string); + debug_printf_indent("%s" UTF8_HORIZ UTF8_HORIZ UTF8_HORIZ + "error message: %s\n", + expand_string_forcedfail ? UTF8_VERT_RIGHT : UTF8_UP_RIGHT, + expand_string_message); + if (expand_string_forcedfail) + debug_printf_indent(UTF8_UP_RIGHT "failure was forced\n"); } if (resetok_p) *resetok_p = resetok; expand_level--; diff --git a/src/src/macros.h b/src/src/macros.h index e4dcf3ccd..4efeee928 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -974,5 +974,13 @@ enum { FILTER_UNSET, FILTER_FORWARD, FILTER_EXIM, FILTER_SIEVE }; #define GETC_BUFFER_UNLIMITED UINT_MAX +/* UTF-8 chars for line-drawing */ + +#define UTF8_DOWN_RIGHT "\xE2\x94\x8c" +#define UTF8_HORIZ "\xE2\x94\x80" +#define UTF8_VERT_RIGHT "\xE2\x94\x9C" +#define UTF8_UP_RIGHT "\xE2\x94\x94" + + /* End of macros.h */ |