cmLex.c : Fixed bug in _cmLexIntMatcher().
This commit is contained in:
parent
0c9f02d130
commit
e0d5b50a64
5
cmLex.c
5
cmLex.c
@ -238,6 +238,7 @@ unsigned _cmLexIntMatcher( cmLex* p, const cmChar_t* cp, unsigned cn, const cm
|
|||||||
{
|
{
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
bool signFl = false;
|
bool signFl = false;
|
||||||
|
unsigned digitCnt = 0;
|
||||||
|
|
||||||
for(; i<cn; ++i)
|
for(; i<cn; ++i)
|
||||||
{
|
{
|
||||||
@ -249,6 +250,8 @@ unsigned _cmLexIntMatcher( cmLex* p, const cmChar_t* cp, unsigned cn, const cm
|
|||||||
|
|
||||||
if( !isdigit(cp[i]) )
|
if( !isdigit(cp[i]) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
++digitCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BUG BUG BUG
|
// BUG BUG BUG
|
||||||
@ -262,7 +265,7 @@ unsigned _cmLexIntMatcher( cmLex* p, const cmChar_t* cp, unsigned cn, const cm
|
|||||||
// containing a decimal point as reals.
|
// containing a decimal point as reals.
|
||||||
|
|
||||||
// if no integer was found
|
// if no integer was found
|
||||||
if( (signFl && i==0) || i==0 )
|
if( digitCnt==0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user