diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/ed.c | 16 | ||||
-rw-r--r-- | editors/vi.c | 2 |
2 files changed, 3 insertions, 15 deletions
diff --git a/editors/ed.c b/editors/ed.c index cceff0c..a569788 100644 --- a/editors/ed.c +++ b/editors/ed.c @@ -847,20 +847,8 @@ static int printLines(int num1, int num2, int expandFlag) count--; while (count-- > 0) { - ch = *cp++; - if (ch & 0x80) { - fputs("M-", stdout); - ch &= 0x7f; - } - if (ch < ' ') { - bb_putchar('^'); - ch += '@'; - } - if (ch == 0x7f) { - bb_putchar('^'); - ch = '?'; - } - bb_putchar(ch); + ch = (unsigned char) *cp++; + fputc_printable(ch | PRINTABLE_META, stdout); } fputs("$\n", stdout); diff --git a/editors/vi.c b/editors/vi.c index b6d4dcf..d8492fe 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -899,7 +899,7 @@ static void colon(char *buf) if (c_is_no_print) { c = '.'; standout_start(); - } + } if (c == '\n') { write1("$\r"); } else if (c < ' ' || c == 127) { |