diff --git a/sh.h b/sh.h index 69f311a..69c6a33 100644 --- a/sh.h +++ b/sh.h @@ -182,7 +182,7 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.855 2018/01/14 00:47:11 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.856 2018/01/14 01:28:15 tg Exp $"); #endif #define MKSH_VERSION "R56 2017/10/17" @@ -1481,7 +1481,7 @@ extern unsigned int eek_ord; size_t ord_c = (c); \ \ if (ord_c > (size_t)0xFFU) \ - internal_errorf("%s:%d:ord(%zu)", \ + internal_errorf("%s:%d:ord(%zX)", \ __FILE__, __LINE__, ord_c); \ ((unsigned int)(unsigned char)(ord_c)); \ })) @@ -1621,7 +1621,7 @@ EXTERN mksh_ari_t x_lins E_INIT(24); #define shf_fileno(shf) ((shf)->fd) #define shf_setfileno(shf,nfd) ((shf)->fd = (nfd)) #define shf_getc_i(shf) ((shf)->rnleft > 0 ? \ - (shf)->rnleft--, *(shf)->rp++ : \ + (shf)->rnleft--, (int)ord(*(shf)->rp++) : \ shf_getchar(shf)) #define shf_putc_i(c, shf) ((shf)->wnleft == 0 ? \ shf_putchar((uint8_t)(c), (shf)) : \ diff --git a/shf.c b/shf.c index d249648..2ee0ec1 100644 --- a/shf.c +++ b/shf.c @@ -2,7 +2,7 @@ /*- * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, - * 2012, 2013, 2015, 2016, 2017 + * 2012, 2013, 2015, 2016, 2017, 2018 * mirabilos * Copyright (c) 2015 * Daniel Richard G. @@ -27,7 +27,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.96 2018/01/13 23:55:14 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.97 2018/01/14 01:28:16 tg Exp $"); /* flags to shf_emptybuf() */ #define EB_READSW 0x01 /* about to switch to reading */ @@ -554,7 +554,7 @@ shf_getchar(struct shf *shf) if (shf->rnleft == 0 && (shf_fillbuf(shf) == -1 || shf->rnleft == 0)) return (-1); --shf->rnleft; - return (*shf->rp++); + return (ord(*shf->rp++)); } /*