Explorar o código

BUG: ISO chars are negative, ISO ints are not.

Roberto Ierusalimschy %!s(int64=29) %!d(string=hai) anos
pai
achega
169870e37d
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      iolib.c

+ 3 - 2
iolib.c

@@ -122,9 +122,10 @@ static void io_read (void)
     }
     else {
       char *ep = item_end(p);  /* get what is next */
-      int m;
+      int m;  /* match result */
       if (c == NEED_OTHER) c = getc(lua_infile);
-      if ((m = singlematch(c, p)) != 0) {
+      m = (c == EOF) ? 0 : singlematch((char)c, p);
+      if (m) {
         if (!inskip) luaI_addchar(c);
         c = NEED_OTHER;
       }