title: grep (BSD grep) 2.5.1-FreeBSD on mac os 10.8 line regexp mode not working with overlapping patterns
body: <p>It seems like the stock version of grep (version info: grep (BSD grep) 2.5.1-FreeBSD) under mac os 10.8 has an issue with patterns sharing a common prefix when being run in line regex mode (-x). In the following minimal example I would expect that grep reports "test" and "test2" but instead only "test" is reported. (Same also holds true for word regexp mode (-w)).</p>
  
  <pre><code>printf "test\ntest2\n" &gt; f1.txt
  printf "test\ntest2\n" &gt; f2.txt
  grep -x -F -f f1.txt f2.txt
  </code></pre>
  
  <p>Has anyone else made similar observations or even knows about a workaround?</p>