diff options
author | Gabor Kovesdan <gabor@FreeBSD.org> | 2010-08-15 22:15:04 +0000 |
---|---|---|
committer | Gabor Kovesdan <gabor@FreeBSD.org> | 2010-08-15 22:15:04 +0000 |
commit | 59218eb770e61b578f0ab296afbbfb381c211939 (patch) | |
tree | 44ced6cc8e38528f9ae4294c0509d9f40b61a7c7 /usr.bin/grep/fastgrep.c | |
parent | 0f7e2491924be07f90f994db40d659cc49d2e413 (diff) | |
download | src-59218eb770e61b578f0ab296afbbfb381c211939.tar.gz src-59218eb770e61b578f0ab296afbbfb381c211939.zip |
- Revert strlcpy() changes to memcpy() because it's more efficient and
former may be safer but in this case it doesn't add extra
safety [1]
- Fix -w option [2]
- Fix handling of GREP_OPTIONS [3]
- Fix --line-buffered
- Make stdin input imply --line-buffered so that tail -f can be piped
to grep [4]
- Imply -h if single file is grepped, this is the GNU behaviour
- Reduce locking overhead to gain some more performance [5]
- Inline some functions to help the compiler better optimize the code
- Use shortcut for empty files [6]
PR: bin/149425 [6]
Prodded by: jilles [1]
Reported by: Alex Kozlov <spam@rm-rf.kiev.ua> [2] [3],
swell.k@gmail.com [2],
poyopoyo@puripuri.plala.or.jp [4]
Submitted by: scf [5],
Shuichi KITAGUCHI <ki@hh.iij4u.or.jp> [6]
Approved by: delphij (mentor)
Notes
Notes:
svn path=/head/; revision=211364
Diffstat (limited to 'usr.bin/grep/fastgrep.c')
-rw-r--r-- | usr.bin/grep/fastgrep.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/grep/fastgrep.c b/usr.bin/grep/fastgrep.c index 5239a0e10336..c66f0a7ae2f6 100644 --- a/usr.bin/grep/fastgrep.c +++ b/usr.bin/grep/fastgrep.c @@ -46,8 +46,8 @@ __FBSDID("$FreeBSD$"); #include "grep.h" -static int grep_cmp(const unsigned char *, const unsigned char *, size_t); -static void grep_revstr(unsigned char *, int); +static inline int grep_cmp(const unsigned char *, const unsigned char *, size_t); +static inline void grep_revstr(unsigned char *, int); void fgrepcomp(fastgrep_t *fg, const char *pat) @@ -273,7 +273,7 @@ grep_search(fastgrep_t *fg, unsigned char *data, size_t len, regmatch_t *pmatch) * Returns: i >= 0 on failure (position that it failed) * -1 on success */ -static int +static inline int grep_cmp(const unsigned char *pat, const unsigned char *data, size_t len) { size_t size; @@ -318,7 +318,7 @@ grep_cmp(const unsigned char *pat, const unsigned char *data, size_t len) return (-1); } -static void +static inline void grep_revstr(unsigned char *str, int len) { int i; |