Changeset 173


Ignore:
Timestamp:
Mar 2, 2010, 2:22:14 PM (11 years ago)
Author:
daqct3
Message:
Update to regular expression matching
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Evidence/DColl.cc

    r172 r173  
    151151          char ErrMsg[200];
    152152          regerror(Ret, &RegEx[i], ErrMsg, sizeof(ErrMsg));
    153           State(WARN, "Error compiling regular expression '%s' (%s)", Token, ErrMsg);
     153          State(FATAL, "Error compiling regular expression '%s' (%s)", Token, ErrMsg);
    154154        }
    155155        else {
    156156          if ((Token=strtok(NULL, ": \t")) != NULL) MinChange[i] = atof(Token);
    157157          else MinChange[i] = 0;
     158
    158159          if ((Token=strtok(NULL, "")) != NULL) HistSize[i] = atoi(Token)*1024;
    159           else HistSize[i] = MIN_HIST_SIZE;
    160           if (HistSize[i] < MIN_HIST_SIZE) HistSize[i] = MIN_HIST_SIZE;
     160          else HistSize[i] = 0;
    161161        }
    162162        Pos += Len;
     
    473473  // Set minimum required change by comparing to regular expressions
    474474  New.MinAbsChange = 0;
    475   New.HistSize = MIN_HIST_SIZE;
     475  New.HistSize = 0;
    476476  for (int i=0; i<RegExCount; i++) {
    477477    if (regexec(&RegEx[i], Name.c_str(), (size_t) 0, NULL, 0) == 0) {
    478478          New.MinAbsChange = MinChange[i];
    479           New.HistSize = HistSize[i];
    480         }
    481   }
     479          if (HistSize[i] != 0) New.HistSize = HistSize[i];
     480        }
     481  }
     482
     483  // At least 3*sizeof(int)
     484  if (New.HistSize < MIN_HIST_SIZE) New.HistSize = MIN_HIST_SIZE;
    482485
    483486  // Create history service
Note: See TracChangeset for help on using the changeset viewer.