diff options
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -66,15 +66,12 @@ static int match = FALSE, beQuiet = FALSE; | |||
66 | static void do_grep(FILE * fp, char *needle, char *fileName, int tellName, | 66 | static void do_grep(FILE * fp, char *needle, char *fileName, int tellName, |
67 | int ignoreCase, int tellLine, int invertSearch) | 67 | int ignoreCase, int tellLine, int invertSearch) |
68 | { | 68 | { |
69 | char *cp; | ||
70 | long line = 0; | 69 | long line = 0; |
71 | char *haystack; | 70 | char *haystack; |
72 | int truth = !invertSearch; | 71 | int truth = !invertSearch; |
73 | 72 | ||
74 | while ((haystack = cstring_lineFromFile(fp))) { | 73 | while ((haystack = cstring_lineFromFile(fp))) { |
75 | line++; | 74 | line++; |
76 | cp = &haystack[strlen(haystack) - 1]; | ||
77 | |||
78 | if (find_match(haystack, needle, ignoreCase) == truth) { | 75 | if (find_match(haystack, needle, ignoreCase) == truth) { |
79 | if (tellName == TRUE) | 76 | if (tellName == TRUE) |
80 | printf("%s:", fileName); | 77 | printf("%s:", fileName); |