From 0ac1df7d4f74b8dfac63e30d039653ab19729ca4 Mon Sep 17 00:00:00 2001 From: Leonard den Ottolander Date: Mon, 27 Nov 2006 21:33:45 +0000 Subject: [PATCH] * src/subshell.c (subshell_name_quote): Bash < 2.05b (3-digit octals in echo_e_cmd) no longer supported. * NEWS: Comment reflecting above change. --- ChangeLog | 5 +++++ NEWS | 6 ++++++ src/ChangeLog | 5 +++++ src/subshell.c | 11 +++++++---- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2dcab0885..f1d55c40f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-27 Leonard den Ottolander + + * NEWS: Bash < 2.05b (3-digit octals in echo_e_cmd) no longer + supported. + 2006-09-07 Pavel Tsekov * acinclude.m4 (AC_GET_FS_INFO): Add erronously removed call to diff --git a/NEWS b/NEWS index e2a923557..f3b7484a3 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,11 @@ Current +- Core functionality. + - Bash < 2.05b no longer supported. For usage with bash < 2.05b fix + subshell_name_quote() to use 3-digit octals. + +Version 4.6.1. + - Core functionality. - Device numbers are displayed correctly. - Improved message formatting for i18n. diff --git a/src/ChangeLog b/src/ChangeLog index f784929bf..3d35819c1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-11-27 Leonard den Ottolander + + * subshell.c (subshell_name_quote): Bash < 2.05b (3-digit octals in + echo_e_cmd) no longer supported. + 2006-11-08 Egmont Koblinger * key.c (get_event): Eliminate timeouts on window resize event. diff --git a/src/subshell.c b/src/subshell.c index 07f983231..a668bcf49 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -747,16 +747,19 @@ subshell_name_quote (const char *s) /* * Print every character in octal format with the leading backslash. - * tcsh and zsh may require 4-digit octals, bash < 2.05b doesn't like them. + * bash >= 3.2, tcsh and zsh require 4-digit octals, 2.05b <= bash < 3.2 + * support 3-digit octals as well as 4-digit octals. + * For bash < 2.05b fix below to use 3-digit octals. */ if (subshell_type == BASH) { for (; *s; s++) { - /* Must quote numbers, so that they are not glued to octals */ + /* Must quote numbers, so that they are not glued to octals + for bash < 3.2 */ if (isalpha ((unsigned char) *s)) { *d++ = (unsigned char) *s; } else { - sprintf (d, "\\%03o", (unsigned char) *s); - d += 4; + sprintf (d, "\\0%03o", (unsigned char) *s); + d += 5; } } } else {