mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
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:
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user