Handle M- as escape. XXX: should probably select the meta-map instead.

From Gerry Swislow  gerry at certif com
This commit is contained in:
christos 2003-11-02 20:06:57 +00:00
parent d94e36f311
commit d67d488ee2

View File

@ -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 * Copyright (c) 1992, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#else #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
#endif /* not lint && not SCCSID */ #endif /* not lint && not SCCSID */
@ -210,6 +210,7 @@ parse__escape(const char **const ptr)
*ptr = ++p; *ptr = ++p;
return (c); return (c);
} }
/* parse__string(): /* parse__string():
* Parse the escapes from in and put the raw string out * Parse the escapes from in and put the raw string out
*/ */
@ -232,6 +233,14 @@ parse__string(char *out, const char *in)
*out++ = n; *out++ = n;
break; break;
case 'M':
if (in[1] == '-' && in[2] != '\0') {
*out++ = '\033';
in += 2;
break;
}
/*FALLTHROUGH*/
default: default:
*out++ = *in++; *out++ = *in++;
break; break;