Archive for July, 2008

BSD grep – Part 2

Monday, July 28th, 2008

I’ve fixed the known issues with BSD grep and rewritten some parts as my mentors suggested. Now I’m waiting for his answer about the current code and if he thinks it’s ok, I’ll submit it to portmgr@ for a thorough test. The last time grep failed on pointyhat due to a bug in -v.

As for BSD diff, I have completed some features, but still there are various to implement. The current status can be seen here.

BSD grep

Tuesday, July 8th, 2008

There were some discussions on hackers@ and current@ about BSD grep, but I haven’t yet written anything about it here, so it’s high time to do so. First, you can see here what I have done. As you see, the list of functions is complete. There is -P (–perl-regexp), which never worked on FreeBSD, but I will try to add this as an optional feature to have a nice and complete grep implementation.

There are some problems, though. GNU accepts non-standard regexes, for example (a|), which has an empty subexpression, while our regex library doesn’t. First, I tried to  workaround these in the code, but as I was pointed out later it broke other cases, thus I had to realize that it was not so easy to fix and I needed to remove those workarounds, thus the problem still persists. I’ve looked at our regex library a bit. It was written by Henry Spencer. He has a new version of his library but that version still has the same behaviour. I’ve been told about the PCRE library, which has a POSIX-compatible interface. I realized that in fact it’s just the interface, the interpretation of the expressions in still Perl-like. Solutions are still needed…