/[pcre2]/code/trunk/src/pcre2grep.c
ViewVC logotype

Diff of /code/trunk/src/pcre2grep.c

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

revision 650 by ph10, Sun Jan 1 12:13:17 2017 UTC revision 651 by ph10, Wed Jan 11 17:10:28 2017 UTC
# Line 386  static option_item optionlist[] = { Line 386  static option_item optionlist[] = {
386    { OP_NODATA,     'h',      NULL,              "no-filename",   "suppress the prefixing filename on output" },    { OP_NODATA,     'h',      NULL,              "no-filename",   "suppress the prefixing filename on output" },
387    { OP_NODATA,     'I',      NULL,              "",              "treat binary files as not matching (ignore)" },    { OP_NODATA,     'I',      NULL,              "",              "treat binary files as not matching (ignore)" },
388    { OP_NODATA,     'i',      NULL,              "ignore-case",   "ignore case distinctions" },    { OP_NODATA,     'i',      NULL,              "ignore-case",   "ignore case distinctions" },
 #ifdef SUPPORT_PCRE2GREP_JIT  
   { OP_NODATA,     N_NOJIT,  NULL,              "no-jit",        "do not use just-in-time compiler optimization" },  
 #else  
   { OP_NODATA,     N_NOJIT,  NULL,              "no-jit",        "ignored: this pcre2grep does not support JIT" },  
 #endif  
389    { 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" },
390    { 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" },
391    { 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 402  static option_item optionlist[] = { Line 397  static option_item optionlist[] = {
397    { OP_NODATA,     'M',      NULL,              "multiline",     "run in multiline mode" },    { OP_NODATA,     'M',      NULL,              "multiline",     "run in multiline mode" },
398    { OP_STRING,     'N',      &newline_arg,      "newline=type",  "set newline type (CR, LF, CRLF, ANYCRLF or ANY)" },    { OP_STRING,     'N',      &newline_arg,      "newline=type",  "set newline type (CR, LF, CRLF, ANYCRLF or ANY)" },
399    { OP_NODATA,     'n',      NULL,              "line-number",   "print line number with output lines" },    { OP_NODATA,     'n',      NULL,              "line-number",   "print line number with output lines" },
400    #ifdef SUPPORT_PCRE2GREP_JIT
401      { OP_NODATA,     N_NOJIT,  NULL,              "no-jit",        "do not use just-in-time compiler optimization" },
402    #else
403      { OP_NODATA,     N_NOJIT,  NULL,              "no-jit",        "ignored: this pcre2grep does not support JIT" },
404    #endif
405    { OP_OP_NUMBERS, 'o',      &only_matching_data, "only-matching=n", "show only the part of the line that matched" },    { OP_OP_NUMBERS, 'o',      &only_matching_data, "only-matching=n", "show only the part of the line that matched" },
406    { OP_STRING,     N_OM_SEPARATOR, &om_separator, "om-separator=text", "set separator for multiple -o output" },    { OP_STRING,     N_OM_SEPARATOR, &om_separator, "om-separator=text", "set separator for multiple -o output" },
407    { OP_NODATA,     'q',      NULL,              "quiet",         "suppress output, just set return code" },    { OP_NODATA,     'q',      NULL,              "quiet",         "suppress output, just set return code" },
# Line 3011  sprintf((char *)buffer, "%s%.*s%s", pref Line 3011  sprintf((char *)buffer, "%s%.*s%s", pref
3011  p->compiled = pcre2_compile(buffer, PCRE2_ZERO_TERMINATED, options, &errcode,  p->compiled = pcre2_compile(buffer, PCRE2_ZERO_TERMINATED, options, &errcode,
3012    &erroffset, compile_context);    &erroffset, compile_context);
3013    
3014  /* Handle successful compile */  /* Handle successful compile. Try JIT-compiling if supported and enabled. We
3015    ignore any JIT compiler errors, relying falling back to interpreting if
3016    anything goes wrong with JIT. */
3017    
3018  if (p->compiled != NULL)  if (p->compiled != NULL)
3019    {    {
3020  #ifdef SUPPORT_PCRE2GREP_JIT  #ifdef SUPPORT_PCRE2GREP_JIT
3021    if (use_jit)    if (use_jit) (void)pcre2_jit_compile(p->compiled, PCRE2_JIT_COMPLETE);
     {  
     errcode = pcre2_jit_compile(p->compiled, PCRE2_JIT_COMPLETE);  
     if (errcode == 0) return TRUE;  
     erroffset = PCRE2_SIZE_MAX;     /* Will get reduced to patlen below */  
     }  
   else  
3022  #endif  #endif
3023    return TRUE;    return TRUE;
3024    }    }
3025    
3026  /* Handle compile and JIT compile errors */  /* Handle compile errors */
3027    
3028  erroffset -= (int)strlen(prefix[popts]);  erroffset -= (int)strlen(prefix[popts]);
3029  if (erroffset > patlen) erroffset = patlen;  if (erroffset > patlen) erroffset = patlen;

Legend:
Removed from v.650  
changed lines
  Added in v.651

  ViewVC Help
Powered by ViewVC 1.1.5