While parsing a key sequence string, escape an escaped character if it
is following a control (\^) binding.
---
 usr.bin/mg/extend.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/usr.bin/mg/extend.c b/usr.bin/mg/extend.c
index 5d342d102fd..82d6df79d56 100644
--- a/usr.bin/mg/extend.c
+++ b/usr.bin/mg/extend.c
@@ -800,7 +800,9 @@ excline(char *line)
                                                 * split into two statements
                                                 * due to bug in OSK cpp
                                                 */
-                                               c = CHARMASK(*++argp);
+                                               if (*++argp == '\\')
+                                                       ++argp;
+                                               c = CHARMASK(*argp);
                                                c = ISLOWER(c) ?
                                                    CCHR(TOUPPER(c)) : CCHR(c);
                                                break;
-- 
2.23.0

Reply via email to