diff options
Diffstat (limited to 'uxd.c')
-rw-r--r-- | uxd.c | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -158,6 +158,7 @@ int java_mode = 0; /* -j */ int wtf8_mode = 0; /* -w */ int permissive = 0; /* -l */ int skip_ascii = 0; /* -a */ +int dot_mode = 0; /* -A */ int line_all_ascii = 1; /* used by -a */ @@ -292,8 +293,10 @@ void parse_args(int argc, char **argv) { version(); } - while((opt = my_getopt(argc, argv, "ajwptTd:1ic:nbl:rmo:S:s:uhv")) != -1) { + while((opt = my_getopt(argc, argv, "AajwptTd:1ic:nbl:rmo:S:s:uhv")) != -1) { switch(opt) { + case 'A': + dot_mode = 1; break; case 'a': skip_ascii = 1; break; case 'j': @@ -420,8 +423,13 @@ void parse_options(int argc, char **argv) { } char *get_special(unsigned char c) { - if(c == 0x7f) return "⌦"; /* tab */ - if(c <= ' ') return special_symbols[c]; + if(dot_mode) { + if(c == 0x7f || c < ' ') return "."; + if(c == ' ') return " "; + } else { + if(c == 0x7f) return "⌦"; /* tab */ + if(c <= ' ') return special_symbols[c]; + } return "?"; /* should never happen */ } @@ -798,7 +806,15 @@ int dump_utf8_char(void) { /* human-readable (right) column: */ append_hilite(right_buf, hl_type); - append_right(printable); + + if(dot_mode && (bad || cont_count)) { + for(i = 0; i <= cont_count; i++) { + append_right("."); + } + } else { + append_right(printable); + } + append_hilite_off(right_buf); /* hex columns: */ |