Changeset 1634


Ignore:
Timestamp:
2000-10-31T12:18:00+13:00 (24 years ago)
Author:
paynter
Message:

Fixed error splitting phrase into prefix/body/suffix when suffix is empty.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/phind/host/phindcgi.cpp

    r1633 r1634  
    779779      prefix.pop_back();
    780780    }
    781     while (*here == ' ') {
     781    if ((here != end) && (*here == ' ')) {
    782782      here++;
    783783    }
     
    800800// UCArray iterators.
    801801//
    802 // Return true if the UCArray is the same as the phrase the iterator points
    803 // too for the length of the UCArray.
     802// Return true if the UCArray is the same as the phrase the iterators point
     803// to for the length of the UCArray.
    804804
    805805bool phrase_match(UCArray text, UCArray::iterator &here, UCArray::iterator end) {
     
    812812  // the corresponding element in the second string.
    813813  while (one_here != one_end) {
    814     if (*one_here != *two_here) {
    815       return false;
    816     }
    817     one_here++;
    818     two_here++;
     814   
     815      if (two_here == end) {
     816      return false;
     817      } else if (*one_here != *two_here) {
     818      return false;
     819      }
     820      one_here++;
     821      two_here++;
    819822  }
    820823
Note: See TracChangeset for help on using the changeset viewer.