+2011-03-15 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Fix MinGW-Bug 3212246.
+
+ * src/keyword.c (has_keyword): Avoid incrementing the comparison
+ pointers when a significant character in one string is not matched in
+ the other; previously the pointers were left pointing one character to
+ the right of the mismatch, and this was overlooked if the mismatch
+ occurred at the rightmost character in both strings.
+
2011-03-12 Keith Marshall <keithmarshall@users.sourceforge.net>
mingw-get-0.2-mingw32-alpha-1 released.
* unchecked section of "in_list"...
*/
const char *inspect = lookup;
- while( *inspect && ! isspace( *in_list ) && (*inspect++ == *in_list++) )
- /*
- * ...advancing pointers to both, with no further action,
+ while( *inspect && ! isspace( *in_list ) && (*inspect == *in_list) )
+ {
+ /* ...advancing pointers to both, with no further action,
* until we find a mismatch.
*/
- ;
+ ++inspect; ++in_list;
+ }
/* If the mismatch coincides with the terminating NUL for "lookup",
* AND we've simultaneously encountered a keyword separator, or the
/* Otherwise, we have not yet found a match...
* Step over any remaining non-white-space characters in the current
- * "in_list" entry, and also the following space character if any...
+ * "in_list" entry, and also the first of any following space characters.
+ * (Note that we don't need to explicitly skip over any additional space
+ * characters preceding the next list entry, if any, since they will be
+ * implicitly skipped in the outer loop).
*/
while( *in_list && ! isspace( *in_list++ ) )
/*