=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/grep/util.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- src/usr.bin/grep/util.c 2010/04/25 14:13:36 1.38 +++ src/usr.bin/grep/util.c 2010/07/02 22:18:03 1.39 @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.38 2010/04/25 14:13:36 eric Exp $ */ +/* $OpenBSD: util.c,v 1.39 2010/07/02 22:18:03 tedu Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -49,8 +49,10 @@ static int linesqueued; static int procline(str_t *l, int); static int grep_search(fastgrep_t *, unsigned char *, size_t, regmatch_t *pmatch); +#ifndef SMALL static int grep_cmp(const unsigned char *, const unsigned char *, size_t); static void grep_revstr(unsigned char *, int); +#endif int grep_tree(char **argv) @@ -217,6 +219,7 @@ return c; } +#ifndef SMALL void fgrepcomp(fastgrep_t *fg, const char *pattern) { @@ -255,6 +258,7 @@ fg->qsBc[tolower(fg->pattern[i])] = fg->patternLen - i; } } +#endif /* * Returns: -1 on failure, 0 on success @@ -262,6 +266,9 @@ int fastcomp(fastgrep_t *fg, const char *pattern) { +#ifdef SMALL + return -1; +#else int i; int bol = 0; int eol = 0; @@ -402,6 +409,7 @@ grep_revstr(fg->pattern, fg->patternLen); return (0); +#endif } /* @@ -418,6 +426,9 @@ static int grep_search(fastgrep_t *fg, unsigned char *data, size_t dataLen, regmatch_t *pmatch) { +#ifdef SMALL + return 0; +#else int j; int rtrnVal = REG_NOMATCH; @@ -491,6 +502,7 @@ } return (rtrnVal); +#endif } @@ -522,6 +534,7 @@ return ptr; } +#ifndef SMALL /* * Returns: i >= 0 on failure (position that it failed) * -1 on success @@ -553,6 +566,7 @@ str[len - i - 1] = c; } } +#endif void printline(str_t *line, int sep)