+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
**************************************************************************
* Copyright (C) 2002-2016 International Business Machines Corporation
if (fMatch) {
return TRUE;
}
+ // In bug 31063104 which has a zero-length text buffer we get here with
+ // inputBuf=NULL, startPos=fActiveLimit=0 (and fMatch F) which violates the
+ // requirement for U16_FWD_1 (utf16.h) that startPos < fActiveLimit. Having
+ // inputBuf=NULL (chunkContexts NULL) is probably due to an error in the
+ // CFStringUText functions. Nevertheless, to be defensive, add test below.
+ if (startPos >= testLen) {
+ fHitEnd = TRUE;
+ return FALSE;
+ }
U16_FWD_1(inputBuf, startPos, fActiveLimit);
}
}
}
fp = StateSave(fp, fp->fPatIdx, status);
+ } else {
+ // Increment time-out counter. (StateSave() does it if count >= minCount)
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
}
+
fp->fPatIdx = opValue + 4; // Loop back.
}
break;
// We haven't met the minimum number of matches yet.
// Loop back for another one.
fp->fPatIdx = opValue + 4; // Loop back.
+ // Increment time-out counter. (StateSave() does it if count >= minCount)
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
} else {
// We do have the minimum number of matches.
}
}
fp = StateSave(fp, fp->fPatIdx, status);
+ } else {
+ // Increment time-out counter. (StateSave() does it if count >= minCount)
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
}
fp->fPatIdx = opValue + 4; // Loop back.
}
// We haven't met the minimum number of matches yet.
// Loop back for another one.
fp->fPatIdx = opValue + 4; // Loop back.
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
} else {
// We do have the minimum number of matches.