diff options
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.152 2017/02/09 14:50:05 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -447,7 +447,7 @@ static int read_number (lua_State *L, FILE *f) { | |||
447 | decp[1] = '.'; /* always accept a dot */ | 447 | decp[1] = '.'; /* always accept a dot */ |
448 | l_lockfile(rn.f); | 448 | l_lockfile(rn.f); |
449 | do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */ | 449 | do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */ |
450 | test2(&rn, "-+"); /* optional signal */ | 450 | test2(&rn, "-+"); /* optional sign */ |
451 | if (test2(&rn, "00")) { | 451 | if (test2(&rn, "00")) { |
452 | if (test2(&rn, "xX")) hex = 1; /* numeral is hexadecimal */ | 452 | if (test2(&rn, "xX")) hex = 1; /* numeral is hexadecimal */ |
453 | else count = 1; /* count initial '0' as a valid digit */ | 453 | else count = 1; /* count initial '0' as a valid digit */ |
@@ -456,7 +456,7 @@ static int read_number (lua_State *L, FILE *f) { | |||
456 | if (test2(&rn, decp)) /* decimal point? */ | 456 | if (test2(&rn, decp)) /* decimal point? */ |
457 | count += readdigits(&rn, hex); /* fractional part */ | 457 | count += readdigits(&rn, hex); /* fractional part */ |
458 | if (count > 0 && test2(&rn, (hex ? "pP" : "eE"))) { /* exponent mark? */ | 458 | if (count > 0 && test2(&rn, (hex ? "pP" : "eE"))) { /* exponent mark? */ |
459 | test2(&rn, "-+"); /* exponent signal */ | 459 | test2(&rn, "-+"); /* exponent sign */ |
460 | readdigits(&rn, 0); /* exponent digits */ | 460 | readdigits(&rn, 0); /* exponent digits */ |
461 | } | 461 | } |
462 | ungetc(rn.c, rn.f); /* unread look-ahead char */ | 462 | ungetc(rn.c, rn.f); /* unread look-ahead char */ |