Changeset 25526

Show
Ignore:
Timestamp:
04.05.2012 17:43:56 (7 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed the problem noticed by Diego and which was thought to be fixed earlier. It had to do with searching for (3 digit) numbers, however Diego particularly experienced the problem when trying the ifl=1 argument (I Feel Lucky) for searching.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/mgpp/text/GSDLQueryLex.cpp

    r24099 r25526  
    9494  el.num = 0; 
    9595  el.lexType = IntegerE; 
     96 
    9697  /* stop integers at 4 digits */ 
    97   while (c >= '0' && c <= '9'&& ++numeric<=MAXNUMERIC) { 
    98     el.num = el.num*10 + c - '0'; 
    99     AddNChar (here, el.text, charLen); 
    100     length += charLen; 
    101     if(numeric < MAXNUMERIC) { // server crash bugfix: don't go past the end with the endMinus1 pointer 
    102         charLen = parse_utf8_char (&*here, endMinus1, &c); 
    103     } 
    104   } 
     98  while (here != end) { 
     99 
     100      charLen = parse_utf8_char (&*here, endMinus1, &c); 
     101      if (c < '0' || c > '9') { 
     102          // reached a non-digit character 
     103          break; 
     104      } 
     105      el.num = el.num*10 + c - '0'; 
     106      AddNChar (here, el.text, charLen); // advances 'here' by 'charLen' 
     107      length += charLen; 
     108 
     109      numeric++; 
     110 
     111      if (numeric == MAXNUMERIC) { 
     112          // reached the max length of a number 
     113          break; 
     114      } 
     115 
     116  } 
     117 
     118 
    105119  // check the next character -if it is a letter, then have a term, not an integer 
    106120  if (!is_unicode_letter(c)) {