diff --git a/contrib/libedit/parse.c b/contrib/libedit/parse.c index 2620f41eb1c..3bfea8126bf 100644 --- a/contrib/libedit/parse.c +++ b/contrib/libedit/parse.c @@ -228,7 +228,17 @@ parse__escape(const wchar_t **ptr) } } else if (*p == '^') { p++; - c = (*p == '?') ? '\177' : (*p & 0237); + switch (*p) { + case '?': + c = '\177'; + break; + case '[': + c = '\033'; + break; + default: + c = *p & 0237; + break; + } } else c = *p; *ptr = ++p;