In order to compile bti, the symbols strndup, getline, strchrnul and dprintf are required.
However, these are missing on Mac OS X, as well as other BSD derivates.
This commit fixes at least getline and strchrnul (strndup and dprintf aren't annoying me, since I don't need url shortening).
optinal getline-frontend via fgetln
getline is in POSIX 2008, the BSDs surely must support that by now.
strchrnul I can understand, but can you please rewrite it to look "sane" (i.e. without ?)