tcsh/tcsh-6.20.00-8bit-cmdkeys.patch

33 lines
989 B
Diff

From dd0f2cbde7ed7ccbcc420613992d6876302b8b0b Mon Sep 17 00:00:00 2001
From: Werner Fink <werner@suse.de>
Date: Fri, 28 Apr 2017 09:21:18 +0200
Subject: [PATCH] Do not convert current used control bytes into wide characters
Signed-off-by: Werner Fink <werner@suse.de>
---
ed.inputl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- ed.inputl.c
+++ ed.inputl.c 2017-04-28 07:12:15.777368417 +0000
@@ -699,7 +699,7 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch)
/* XXX: This needs to be fixed so that we don't just truncate
* the character, we unquote it.
*/
- if (*ch < NT_NUM_KEYS)
+ if (*ch > 0 && *ch < NT_NUM_KEYS)
cmd = CurrentKeyMap[*ch];
else
#ifdef WINNT_NATIVE
@@ -800,6 +800,10 @@ GetNextChar(Char *cp)
return -1;
}
}
+ if (cbp == 0 && *cbuf < NT_NUM_KEYS && CurrentKeyMap[(unsigned char)*cbuf] == F_XKEY) {
+ *cp = (unsigned char)*cbuf;
+ break;
+ }
cbp++;
if (normal_mbtowc(cp, cbuf, cbp) == -1) {
reset_mbtowc();