Kludge peek() and poke() to not sign extend on machines with signed chars,

so a 0xff character will not sign extend and become an EOF.  This breaks
a test in mun\CC\83oz.t (which tripped the 0xff becomes EOF bug) so that
test needed to be rewritten.

Inline comment handling is still broken!  It only checks for a > to end
a html comment, not the correct --> sequence!
This commit is contained in:
david parsons
2016-07-16 15:06:40 -07:00
parent d37ccb7195
commit 0d71ce7785
+4 -4
View File
@@ -50,22 +50,22 @@ pushc(char c, MMIOT *f)
/* look <i> characters ahead of the cursor.
*/
static inline int
static inline unsigned int
peek(MMIOT *f, int i)
{
i += (f->isp-1);
return (i >= 0) && (i < S(f->in)) ? T(f->in)[i] : EOF;
return (i >= 0) && (i < S(f->in)) ? (unsigned char)T(f->in)[i] : EOF;
}
/* pull a byte from the input buffer
*/
static inline int
static inline unsigned int
pull(MMIOT *f)
{
return ( f->isp < S(f->in) ) ? T(f->in)[f->isp++] : EOF;
return ( f->isp < S(f->in) ) ? (unsigned char)T(f->in)[f->isp++] : EOF;
}