/[pcre]/code/trunk/pcregrep.c
ViewVC logotype

Diff of /code/trunk/pcregrep.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 654 by ph10, Tue Aug 2 11:00:40 2011 UTC revision 667 by ph10, Mon Aug 22 14:57:32 2011 UTC
# Line 168  static int error_count = 0; Line 168  static int error_count = 0;
168  static int filenames = FN_DEFAULT;  static int filenames = FN_DEFAULT;
169  static int only_matching = -1;  static int only_matching = -1;
170  static int process_options = 0;  static int process_options = 0;
171    static int study_options = 0;
172    
173  static unsigned long int match_limit = 0;  static unsigned long int match_limit = 0;
174  static unsigned long int match_limit_recursion = 0;  static unsigned long int match_limit_recursion = 0;
# Line 238  static option_item optionlist[] = { Line 239  static option_item optionlist[] = {
239    { OP_NODATA,     'H',      NULL,              "with-filename", "force the prefixing filename on output" },    { OP_NODATA,     'H',      NULL,              "with-filename", "force the prefixing filename on output" },
240    { OP_NODATA,     'h',      NULL,              "no-filename",   "suppress the prefixing filename on output" },    { OP_NODATA,     'h',      NULL,              "no-filename",   "suppress the prefixing filename on output" },
241    { OP_NODATA,     'i',      NULL,              "ignore-case",   "ignore case distinctions" },    { OP_NODATA,     'i',      NULL,              "ignore-case",   "ignore case distinctions" },
242      { OP_NODATA,     'j',      NULL,              "jit",           "use JIT compiler if available" },
243    { OP_NODATA,     'l',      NULL,              "files-with-matches", "print only FILE names containing matches" },    { OP_NODATA,     'l',      NULL,              "files-with-matches", "print only FILE names containing matches" },
244    { OP_NODATA,     'L',      NULL,              "files-without-match","print only FILE names not containing matches" },    { OP_NODATA,     'L',      NULL,              "files-without-match","print only FILE names not containing matches" },
245    { OP_STRING,     N_LABEL,  &stdin_name,       "label=name",    "set name for standard input" },    { OP_STRING,     N_LABEL,  &stdin_name,       "label=name",    "set name for standard input" },
# Line 1862  switch(letter) Line 1864  switch(letter)
1864    case 'H': filenames = FN_FORCE; break;    case 'H': filenames = FN_FORCE; break;
1865    case 'h': filenames = FN_NONE; break;    case 'h': filenames = FN_NONE; break;
1866    case 'i': options |= PCRE_CASELESS; break;    case 'i': options |= PCRE_CASELESS; break;
1867      case 'j': study_options |= PCRE_STUDY_JIT_COMPILE; break;
1868    case 'l': omit_zero_count = TRUE; filenames = FN_MATCH_ONLY; break;    case 'l': omit_zero_count = TRUE; filenames = FN_MATCH_ONLY; break;
1869    case 'L': filenames = FN_NOMATCH_ONLY; break;    case 'L': filenames = FN_NOMATCH_ONLY; break;
1870    case 'M': multiline = TRUE; options |= PCRE_MULTILINE|PCRE_FIRSTLINE; break;    case 'M': multiline = TRUE; options |= PCRE_MULTILINE|PCRE_FIRSTLINE; break;
# Line 2571  if (pattern_filename != NULL) Line 2574  if (pattern_filename != NULL)
2574    
2575  for (j = 0; j < pattern_count; j++)  for (j = 0; j < pattern_count; j++)
2576    {    {
2577    hints_list[j] = pcre_study(pattern_list[j], 0, &error);    hints_list[j] = pcre_study(pattern_list[j], study_options, &error);
2578    if (error != NULL)    if (error != NULL)
2579      {      {
2580      char s[16];      char s[16];
# Line 2696  if (hints_list != NULL) Line 2699  if (hints_list != NULL)
2699    {    {
2700    for (i = 0; i < hint_count; i++)    for (i = 0; i < hint_count; i++)
2701      {      {
2702      if (hints_list[i] != NULL) free(hints_list[i]);      if (hints_list[i] != NULL) pcre_free_study(hints_list[i]);
2703      }      }
2704    free(hints_list);    free(hints_list);
2705    }    }

Legend:
Removed from v.654  
changed lines
  Added in v.667

  ViewVC Help
Powered by ViewVC 1.1.5