nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e59a0f5e771c272ef79bb05f7fdc7c1cf5c2a8fe
parent fd10c0eadd64e3afd014ca664fd15e34a1decd1c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 22 Jul 2020 09:07:14 +0200

build: replace the non-standard backslash escape "\e" with "\x1B"

Older compilers do not understand "\e".  Also, it's not in the standard
(see http://open-std.org/JTC1/SC22/WG14/www/docs/n1570.pdf, ยง6.4.4.4).

This addresses https://savannah.gnu.org/bugs/?58799.
Reported-by: Henry Bent <henry.r.bent@gmail.com>

Diffstat:
Msrc/nano.c | 4++--
Msrc/winio.c | 4++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -226,7 +226,7 @@ void restore_terminal(void) curs_set(1); endwin(); #ifndef NANO_TINY - printf("\e[?2004l"); + printf("\x1B[?2004l"); fflush(stdout); #endif tcsetattr(0, TCSANOW, &original_state); @@ -1223,7 +1223,7 @@ void terminal_init(void) #ifndef NANO_TINY /* Tell the terminal to enable bracketed pastes. */ - printf("\e[?2004h"); + printf("\x1B[?2004h"); fflush(stdout); #endif } diff --git a/src/winio.c b/src/winio.c @@ -1499,7 +1499,7 @@ char *get_verbatim_kbinput(WINDOW *win, size_t *count) #ifndef NANO_TINY /* Turn bracketed-paste mode off. */ - printf("\e[?2004l"); + printf("\x1B[?2004l"); fflush(stdout); #endif @@ -1520,7 +1520,7 @@ char *get_verbatim_kbinput(WINDOW *win, size_t *count) #ifndef NANO_TINY /* Turn bracketed-paste mode back on. */ - printf("\e[?2004h"); + printf("\x1B[?2004h"); fflush(stdout); #endif