summaryrefslogtreecommitdiff
path: root/lib/libedit/parse.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2003-11-02 20:06:57 +0000
committerchristos <christos@NetBSD.org>2003-11-02 20:06:57 +0000
commitd67d488ee21740f2acaaa276f1496bbd5d52744f (patch)
treed7dc59b7b43c912498751502231ae376814e0a5f /lib/libedit/parse.c
parentd94e36f3117a6c3d2dad5659cc9e8b13a0780ba1 (diff)
Handle M- as escape. XXX: should probably select the meta-map instead.
From Gerry Swislow gerry at certif com
Diffstat (limited to 'lib/libedit/parse.c')
-rw-r--r--lib/libedit/parse.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c
index ffe890955bd..e7a36b300bf 100644
--- a/lib/libedit/parse.c
+++ b/lib/libedit/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.18 2003/10/15 18:08:40 christos Exp $ */
+/* $NetBSD: parse.c,v 1.19 2003/11/02 20:06:57 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: parse.c,v 1.18 2003/10/15 18:08:40 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.19 2003/11/02 20:06:57 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -210,6 +210,7 @@ parse__escape(const char **const ptr)
*ptr = ++p;
return (c);
}
+
/* parse__string():
* Parse the escapes from in and put the raw string out
*/
@@ -232,6 +233,14 @@ parse__string(char *out, const char *in)
*out++ = n;
break;
+ case 'M':
+ if (in[1] == '-' && in[2] != '\0') {
+ *out++ = '\033';
+ in += 2;
+ break;
+ }
+ /*FALLTHROUGH*/
+
default:
*out++ = *in++;
break;