diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 7b1e91119..2cf8262b7 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -4257,22 +4257,20 @@ static mrb_bool skips(parser_state *p, const char *s); static inline int nextc0(parser_state *p) { - int c; - if (p->s && p->s < p->send) { - c = (unsigned char)*p->s++; + return (unsigned char)*p->s++; } else { #ifndef MRB_NO_STDIO + int c; + if (p->f) { c = fgetc(p->f); - if (feof(p->f)) return -1; + if (!feof(p->f)) return c; } - else #endif - return -1; + return -1; } - return c; } static inline int diff --git a/mrbgems/mruby-compiler/core/y.tab.c b/mrbgems/mruby-compiler/core/y.tab.c index 7dbd3813c..c493d3192 100644 --- a/mrbgems/mruby-compiler/core/y.tab.c +++ b/mrbgems/mruby-compiler/core/y.tab.c @@ -10496,22 +10496,20 @@ static mrb_bool skips(parser_state *p, const char *s); static inline int nextc0(parser_state *p) { - int c; - if (p->s && p->s < p->send) { - c = (unsigned char)*p->s++; + return (unsigned char)*p->s++; } else { #ifndef MRB_NO_STDIO + int c; + if (p->f) { c = fgetc(p->f); - if (feof(p->f)) return -1; + if (!feof(p->f)) return c; } - else #endif - return -1; + return -1; } - return c; } static inline int