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 cceff0c40..a569788ad 100644 --- a/editors/ed.c +++ b/editors/ed.c | |||
@@ -847,20 +847,8 @@ static int printLines(int num1, int num2, int expandFlag) | |||
847 | count--; | 847 | count--; |
848 | 848 | ||
849 | while (count-- > 0) { | 849 | while (count-- > 0) { |
850 | ch = *cp++; | 850 | ch = (unsigned char) *cp++; |
851 | if (ch & 0x80) { | 851 | fputc_printable(ch | PRINTABLE_META, stdout); |
852 | fputs("M-", stdout); | ||
853 | ch &= 0x7f; | ||
854 | } | ||
855 | if (ch < ' ') { | ||
856 | bb_putchar('^'); | ||
857 | ch += '@'; | ||
858 | } | ||
859 | if (ch == 0x7f) { | ||
860 | bb_putchar('^'); | ||
861 | ch = '?'; | ||
862 | } | ||
863 | bb_putchar(ch); | ||
864 | } | 852 | } |
865 | 853 | ||
866 | fputs("$\n", stdout); | 854 | fputs("$\n", stdout); |
diff --git a/editors/vi.c b/editors/vi.c index b6d4dcf0d..d8492fe74 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -899,7 +899,7 @@ static void colon(char *buf) | |||
899 | if (c_is_no_print) { | 899 | if (c_is_no_print) { |
900 | c = '.'; | 900 | c = '.'; |
901 | standout_start(); | 901 | standout_start(); |
902 | } | 902 | } |
903 | if (c == '\n') { | 903 | if (c == '\n') { |
904 | write1("$\r"); | 904 | write1("$\r"); |
905 | } else if (c < ' ' || c == 127) { | 905 | } else if (c < ' ' || c == 127) { |