Browse Source

cmLex.c : Fixed bug in _cmLexIntMatcher().

master
Kevin Larke 8 years ago
parent
commit
e0d5b50a64
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      cmLex.c

+ 5
- 2
cmLex.c View File

@@ -238,7 +238,8 @@ unsigned _cmLexIntMatcher(   cmLex* p, const cmChar_t* cp, unsigned cn, const cm
238 238
 {
239 239
   unsigned i = 0;
240 240
   bool signFl = false;
241
-
241
+  unsigned digitCnt = 0;
242
+  
242 243
   for(; i<cn; ++i)
243 244
   {
244 245
     if( i==0 && cp[i]=='-' )
@@ -249,6 +250,8 @@ unsigned _cmLexIntMatcher(   cmLex* p, const cmChar_t* cp, unsigned cn, const cm
249 250
 
250 251
     if( !isdigit(cp[i]) )
251 252
       break;
253
+
254
+    ++digitCnt;
252 255
   }
253 256
 
254 257
   // BUG BUG BUG
@@ -262,7 +265,7 @@ unsigned _cmLexIntMatcher(   cmLex* p, const cmChar_t* cp, unsigned cn, const cm
262 265
   // containing a decimal point as reals. 
263 266
 
264 267
   // if no integer was found
265
-  if( (signFl && i==0) || i==0 )
268
+  if( digitCnt==0)
266 269
     return 0;
267 270
 
268 271
 

Loading…
Cancel
Save