Backslashed escape sequences

Marc W. Abel me at marcabel.com
Thu Sep 18 14:16:17 UTC 2008


Hi,

Apologies if this has gone through this list in prior months/years; I
would have to download all to check!

I propose this change to libbb/process_escape_sequence.c

FROM
	static const char charmap[] ALIGN1 = {
		'a',  'b',  'f',  'n',  'r',  't',  'v',  '\\', 0,
		'\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' };

TO
	static const char charmap[] ALIGN1 = {
		'a',  'b',  'e', 'f',  'n',  'r',  't',  'v',  '\\', 0,
		'\a', '\b', 27, '\f', '\n', '\r', '\t', '\v', '\\', '\\' };

for the purpose of supporting the \e escape sequence for the ASCII
escape character.  This sequence has long been recognized by GNU gcc and
GNU bash.

In the translate-to (last) line of the change, I suggest using 27 in
lieu of '\e' in case someone builds BusyBox with a compiler which does
not support '\e'.

Just a thought.

Marc



More information about the busybox mailing list