shell: Fix unsigned char promotion and truncation

When a char is promoted to an int, it needs to be signed as otherwise
comparisons on it may fail.  Alternatively, an integer needs to be
truncated to char before comparing it against another char.

Reported-by: Juergen Daubert <j.daubert@posteo.de>
Fixes: e878137f63e6 ("expand: Do not call rmescapes in expari")
Fixes: c5bf9702ea11 ("expand: Add multi-byte support to pmatch")
Fixes: 8f01c3796f0f ("[PARSER] Add FAKEEOFMARK for expandstr")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2 files changed