Port of OpenBSD's sdiff

Sean C. Farley sean-freebsd at farley.org
Sun Jun 24 16:21:39 UTC 2007

On Fri, 22 Jun 2007, Gabor Kovesdan wrote:

> Hello Steven,
> these are very good news! You might also want to take a look at
> textproc/bsddiff, textproc/bsdgrep and textproc/bsdsort. These are the
> BSD-licensed text processing tools from OpenBSD,


I have been looking at freegrep (original source of OpenBSD's grep) off
and on for years.  Here[1] is where I proposed it for FreeBSD awhile
ago.  This is the patch[2] (part of OpenBSD's grep) I wrote for speeding
up non-regex related searches.

I am interested in fixing it up to be worthy for inclusion.  Here are a
few important issues with it:

1. Not multi-byte tested that I know.
2. Uses mmap() instead of read() for scanning a file.  This makes it a
    bit slower than GNU's grep.  OTOH, it makes the code much simpler.
3. fgrep examines each expression in turn.  It should use something like
    a tree to consolidate the expressions if possible.

   1. http://lists.freebsd.org/pipermail/freebsd-hackers/2003-June/001612.html
   2. http://www.farley.org/?page=software#freegrep
sean-freebsd at farley.org

More information about the freebsd-current mailing list