diff --git a/usr.bin/look/look.c b/usr.bin/look/look.c index 4e8cf34797c8..e77a21652d1c 100644 --- a/usr.bin/look/look.c +++ b/usr.bin/look/look.c @@ -77,14 +77,14 @@ static char _path_words[] = _PATH_WORDS; #define GREATER 1 #define LESS (-1) -int dflag, fflag; +static int dflag, fflag; -char *binary_search(wchar_t *, unsigned char *, unsigned char *); -int compare(wchar_t *, unsigned char *, unsigned char *); -char *linear_search(wchar_t *, unsigned char *, unsigned char *); -int look(wchar_t *, unsigned char *, unsigned char *); -wchar_t *prepkey(const char *, wchar_t); -void print_from(wchar_t *, unsigned char *, unsigned char *); +static char *binary_search(wchar_t *, unsigned char *, unsigned char *); +static int compare(wchar_t *, unsigned char *, unsigned char *); +static char *linear_search(wchar_t *, unsigned char *, unsigned char *); +static int look(wchar_t *, unsigned char *, unsigned char *); +static wchar_t *prepkey(const char *, wchar_t); +static void print_from(wchar_t *, unsigned char *, unsigned char *); static void usage(void); @@ -151,7 +151,7 @@ main(int argc, char *argv[]) exit(match); } -wchar_t * +static wchar_t * prepkey(const char *string, wchar_t termchar) { const char *readp; @@ -182,7 +182,7 @@ prepkey(const char *string, wchar_t termchar) return (key); } -int +static int look(wchar_t *string, unsigned char *front, unsigned char *back) { @@ -236,7 +236,7 @@ look(wchar_t *string, unsigned char *front, unsigned char *back) #define SKIP_PAST_NEWLINE(p, back) \ while (p < back && *p++ != '\n'); -char * +static char * binary_search(wchar_t *string, unsigned char *front, unsigned char *back) { unsigned char *p; @@ -270,7 +270,7 @@ binary_search(wchar_t *string, unsigned char *front, unsigned char *back) * o front points at the first character in a line. * o front is before or at the first line to be printed. */ -char * +static char * linear_search(wchar_t *string, unsigned char *front, unsigned char *back) { while (front < back) { @@ -290,7 +290,7 @@ linear_search(wchar_t *string, unsigned char *front, unsigned char *back) /* * Print as many lines as match string, starting at front. */ -void +static void print_from(wchar_t *string, unsigned char *front, unsigned char *back) { for (; front < back && compare(string, front, back) == EQUAL; ++front) { @@ -315,7 +315,7 @@ print_from(wchar_t *string, unsigned char *front, unsigned char *back) * The string "s1" is null terminated. The string s2 is '\n' terminated (or * "back" terminated). */ -int +static int compare(wchar_t *s1, unsigned char *s2, unsigned char *back) { wchar_t ch1, ch2;