[git commit master] echo et al: support \e escape

Denys Vlasenko vda.linux at googlemail.com
Thu Oct 29 02:39:55 UTC 2009


commit: http://git.busybox.net/busybox/commit/?id=00f0ef4a0cd58582a15afcc77f4601013ce0861c
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/process_escape_sequence.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c
index 11059d1..3ad908b 100644
--- a/libbb/process_escape_sequence.c
+++ b/libbb/process_escape_sequence.c
@@ -20,10 +20,11 @@ char FAST_FUNC bb_process_escape_sequence(const char **ptr)
 {
 	/* bash builtin "echo -e '\ec'" interprets \e as ESC,
 	 * but coreutils "/bin/echo -e '\ec'" does not.
-	 * manpages tend to support coreutils way. */
+	 * manpages tend to support coreutils way.
+	 * Update: coreutils added support for \e on 28 Oct 2009. */
 	static const char charmap[] ALIGN1 = {
-		'a',  'b', /*'e',*/ 'f',  'n',  'r',  't',  'v',  '\\', 0,
-		'\a', '\b', /*27,*/ '\f', '\n', '\r', '\t', '\v', '\\', '\\' };
+		'a',  'b', 'e', 'f',  'n',  'r',  't',  'v',  '\\', 0,
+		'\a', '\b', 27, '\f', '\n', '\r', '\t', '\v', '\\', '\\' };
 
 	const char *p;
 	const char *q;
-- 
1.6.3.3



More information about the busybox-cvs mailing list