--- code/trunk/pcregrep.c 2007/03/29 13:56:00 137 +++ code/trunk/pcregrep.c 2007/03/30 15:46:27 141 @@ -1408,7 +1408,11 @@ suffix[process_options]); pattern_list[pattern_count] = pcre_compile(buffer, options, &error, &errptr, pcretables); -if (pattern_list[pattern_count++] != NULL) return TRUE; +if (pattern_list[pattern_count] != NULL) + { + pattern_count++; + return TRUE; + } /* Handle compile errors */ @@ -1490,6 +1494,7 @@ int rc = 1; int pcre_options = 0; int cmd_pattern_count = 0; +int hint_count = 0; int errptr; BOOL only_one_at_top; char *patterns[MAX_PATTERN_COUNT]; @@ -1942,6 +1947,7 @@ fprintf(stderr, "pcregrep: Error while studying regex%s: %s\n", s, error); goto EXIT2; } + hint_count++; } /* If there are include or exclude patterns, compile them. */ @@ -2001,7 +2007,7 @@ } if (hints_list != NULL) { - for (i = 0; i < pattern_count; i++) free(hints_list[i]); + for (i = 0; i < hint_count; i++) free(hints_list[i]); free(hints_list); } return rc;