From e59a0f5e771c272ef79bb05f7fdc7c1cf5c2a8fe Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 22 Jul 2020 09:07:14 +0200 Subject: [PATCH] build: replace the non-standard backslash escape "\e" with "\x1B" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/nano.c | 4 ++-- src/winio.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nano.c b/src/nano.c index e4496732..bc502b13 100644 --- 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 index 41ea66ff..8029273b 100644 --- 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