summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2008-09-19 23:43:59 +0000
committerDenis Vlasenko2008-09-19 23:43:59 +0000
commit248b4a77e7d1f0ad3d98ede8af75c254488844ce (patch)
tree61096b12e83a94b0d6b3969e889f7b7e4295242d
parent9ac706b7a6074186eaaafd5a2ecfd84b5ddc80dc (diff)
downloadbusybox-248b4a77e7d1f0ad3d98ede8af75c254488844ce.zip
busybox-248b4a77e7d1f0ad3d98ede8af75c254488844ce.tar.gz
libbb: document that we maybe will want to understand \e someday
(no code changes)
-rw-r--r--libbb/process_escape_sequence.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c
index 4d03bd6..6de2cac 100644
--- a/libbb/process_escape_sequence.c
+++ b/libbb/process_escape_sequence.c
@@ -18,17 +18,20 @@
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. */
static const char charmap[] ALIGN1 = {
- 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0,
- '\a', '\b', '\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;
- unsigned int num_digits;
- unsigned int r;
- unsigned int n;
- unsigned int d;
- unsigned int base;
+ unsigned num_digits;
+ unsigned r;
+ unsigned n;
+ unsigned d;
+ unsigned base;
num_digits = n = 0;
base = 8;