1
0
mirror of https://github.com/lua/lua.git synced 2025-02-04 06:13:04 +08:00
This commit is contained in:
Roberto Ierusalimschy 2011-07-08 17:01:38 -03:00
parent df19931ddc
commit 32e09c2a16

8
llex.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: llex.c,v 2.51 2011/07/06 16:45:14 roberto Exp roberto $ ** $Id: llex.c,v 2.52 2011/07/08 19:17:30 roberto Exp roberto $
** Lexical Analyzer ** Lexical Analyzer
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -314,9 +314,9 @@ static int readhexaesc (LexState *ls) {
static int readdecesc (LexState *ls) { static int readdecesc (LexState *ls) {
int c[3], r; int c[3], r;
int i = 0; int i = 2; /* at least two chars will be read */
c[i++] = ls->current; /* first char must be a digit */ c[0] = ls->current; /* first char must be a digit */
c[i++] = next(ls); /* read second char */ c[1] = next(ls); /* read second char */
r = c[0] - '0'; /* partial result */ r = c[0] - '0'; /* partial result */
if (lisdigit(c[1])) { if (lisdigit(c[1])) {
c[i++] = next(ls); /* read third char */ c[i++] = next(ls); /* read third char */