[input] proper escape trie traversal

This commit is contained in:
nick black 2021-09-15 16:03:33 -04:00
parent 0c16296b96
commit 37fbd385bb
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -1235,10 +1235,11 @@ process_escape(inputctx* ictx, const unsigned char* buf, int buflen){
handoff_initial_responses(ictx);
}
logtrace("triepos: %p in: %u special: 0x%08x\n", ictx->triepos, buf[used], ictx->triepos->special);
if((ictx->triepos = ictx->triepos->trie[buf[used]]) == NULL){
ictx->triepos = ictx->inputescapes;
}else if(ictx->triepos->special != NCKEY_INVALID){
if(ictx->triepos->special != NCKEY_INVALID){
special_key(ictx);
ictx->triepos = ictx->inputescapes;
}else if((ictx->triepos = ictx->triepos->trie[buf[used]]) == NULL){
ictx->triepos = ictx->inputescapes;
}
++used;
}