ggreer/the_silver_searcher — pull request #80 by c4rlo (2012-09-30 13:35:52+00:00)
Title: "-w" fix; remove strlcat once again; option parsing switch fallthrough fix

Hi! Here's what the three commits are doing:

- c8ee20a: Trivial fix, add a missing `break;` in the option parsing. I noticed that the option in question, `-r` is not documented and given the `--depth` option possibly useless anyway.
- bcd8e2d: Remove strlcat and strlcpy once again. These were removed in 579af6d24a and added back again in d5625e4d81. Linux does not have these, so we can't use them. My solution is to use manual `memcpy`ing, which saves some unnecessary hunting for the null terminator that `strlcat` would have to do.
- 29f9ae1: This is the major one. In non-literal mode, the `-w` option, translates to a set of `\b`s around the regexp, which [means](http://perldoc.perl.org/perlre.html#Assertions) that the word has to lie at [word-character](http://perldoc.perl.org/perlrecharclass.html#Word-characters) boundaries. It makes sense to keep the same semantics for literal mode, especially given that literal mode is enabled implicitly if the query has no regex special characters. The old behaviour is that the match must be surrounded by whitespace characters.