diff options
Diffstat (limited to 'misc-utils/look.c')
-rw-r--r-- | misc-utils/look.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/misc-utils/look.c b/misc-utils/look.c index 5a47970ed..13cb67872 100644 --- a/misc-utils/look.c +++ b/misc-utils/look.c @@ -92,6 +92,7 @@ void print_from __P((char *, char *, char *)); static void usage __P((void)); +void main(argc, argv) int argc; char *argv[]; @@ -102,6 +103,8 @@ main(argc, argv) file = _PATH_WORDS; termchar = '\0'; + string = NULL; /* just for gcc */ + while ((ch = getopt(argc, argv, "adft:")) != EOF) switch(ch) { case 'a': @@ -152,6 +155,7 @@ main(argc, argv) exit(look(string, front, back)); } +int look(string, front, back) char *string, *front, *back; { @@ -159,7 +163,7 @@ look(string, front, back) register char *readp, *writep; /* Reformat string string to avoid doing it multiple times later. */ - for (readp = writep = string; ch = *readp++;) { + for (readp = writep = string; (ch = *readp++) != 0;) { if (fflag) ch = FOLD(ch); if (dflag) |