Page MenuHomeFreeBSD

Teach libedit how to parse ^[

Authored By
pstef
Aug 19 2024, 10:24 PM
Size
732 B
Referenced Files
None
Subscribers
None

Teach libedit how to parse ^[

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;

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11140605
Default Alt Text
Teach libedit how to parse ^[ (732 B)

Event Timeline