lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / libbb / process_escape_sequence.c
index 11059d1a5204ffa87f02dc89a16aa2e46c9333c2..82cbe10dc7f9217e45b047aa2767f17249b1481f 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (C) Manuel Novoa III <mjn3@codepoet.org>
  * and Vladimir Oleynik <dzo@simtreas.ru>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
@@ -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;