Added some "const" qualifiers to variables in pcre2grep.

This commit is contained in:
Philip.Hazel 2016-10-14 15:47:27 +00:00
parent ff6bec1991
commit 6c72b76a64
2 changed files with 14 additions and 11 deletions

View File

@ -72,6 +72,8 @@ without it (something that neither ./configure nor CMake allow, but it can be
done by editing config.h), pcre2grep was giving a JIT error. Now it detects done by editing config.h), pcre2grep was giving a JIT error. Now it detects
this situation and does not try to use JIT. this situation and does not try to use JIT.
12. Added some "const" qualifiers to variables in pcre2grep.
Version 10.22 29-July-2016 Version 10.22 29-July-2016
-------------------------- --------------------------

View File

@ -158,15 +158,16 @@ static const char *jfriedl_prefix = "";
static const char *jfriedl_postfix = ""; static const char *jfriedl_postfix = "";
#endif #endif
static char *colour_string = (char *)"1;31"; static const char *colour_string = (char *)"1;31";
static char *colour_option = NULL; static const char *colour_option = NULL;
static char *dee_option = NULL; static const char *dee_option = NULL;
static char *DEE_option = NULL; static const char *DEE_option = NULL;
static char *locale = NULL; static const char *locale = NULL;
static const char *newline_arg = NULL;
static const char *om_separator = (char *)"";
static const char *stdin_name = (char *)"(standard input)";
static char *main_buffer = NULL; static char *main_buffer = NULL;
static char *newline_arg = NULL;
static char *om_separator = (char *)"";
static char *stdin_name = (char *)"(standard input)";
static int after_context = 0; static int after_context = 0;
static int before_context = 0; static int before_context = 0;
@ -1423,7 +1424,7 @@ Returns: nothing
static void static void
do_after_lines(int lastmatchnumber, char *lastmatchrestart, char *endptr, do_after_lines(int lastmatchnumber, char *lastmatchrestart, char *endptr,
char *printname) const char *printname)
{ {
if (after_context > 0 && lastmatchnumber > 0) if (after_context > 0 && lastmatchnumber > 0)
{ {
@ -1829,7 +1830,7 @@ Returns: 0 if there was at least one match
*/ */
static int static int
pcre2grep(void *handle, int frtype, char *filename, char *printname) pcre2grep(void *handle, int frtype, const char *filename, const char *printname)
{ {
int rc = 1; int rc = 1;
int linenumber = 1; int linenumber = 1;
@ -2894,7 +2895,7 @@ read_pattern_file(char *name, patstr **patptr, patstr **patlastptr, int popts)
{ {
int linenumber = 0; int linenumber = 0;
FILE *f; FILE *f;
char *filename; const char *filename;
char buffer[PATBUFSIZE]; char buffer[PATBUFSIZE];
if (strcmp(name, "-") == 0) if (strcmp(name, "-") == 0)