--- code/trunk/pcregrep.c 2007/02/24 21:40:10 66 +++ code/trunk/pcregrep.c 2007/02/24 21:40:13 67 @@ -45,8 +45,8 @@ typedef struct option_item { int one_char; - char *long_name; - char *help_text; + const char *long_name; + const char *help_text; } option_item; static option_item optionlist[] = { @@ -85,7 +85,7 @@ typedef DIR directory_type; -int +static int isdirectory(char *filename) { struct stat statbuf; @@ -94,13 +94,13 @@ return ((statbuf.st_mode & S_IFMT) == S_IFDIR)? '/' : 0; } -directory_type * +static directory_type * opendirectory(char *filename) { return opendir(filename); } -char * +static char * readdirectory(directory_type *dir) { for (;;) @@ -113,7 +113,7 @@ return NULL; /* Keep compiler happy; never executed */ } -void +static void closedirectory(directory_type *dir) { closedir(dir); @@ -320,7 +320,7 @@ *************************************************/ static int -grep_or_recurse(char *filename, BOOL recurse, BOOL show_filenames, +grep_or_recurse(char *filename, BOOL dir_recurse, BOOL show_filenames, BOOL only_one_at_top) { int rc = 1; @@ -330,7 +330,7 @@ /* If the file is a directory and we are recursing, scan each file within it. The scanning code is localized so it can be made system-specific. */ -if ((sep = isdirectory(filename)) != 0 && recurse) +if ((sep = isdirectory(filename)) != 0 && dir_recurse) { char buffer[1024]; char *nextfile; @@ -347,7 +347,7 @@ { int frc; sprintf(buffer, "%.512s%c%.128s", filename, sep, nextfile); - frc = grep_or_recurse(buffer, recurse, TRUE, FALSE); + frc = grep_or_recurse(buffer, dir_recurse, TRUE, FALSE); if (frc == 0 && rc == 1) rc = 0; }