Mon 07 Mar 2005 01:41:07 PM UTC, original submission:
These changes aim at making grep more maintenable for the future, and avoiding bugs resulting from design problems.
Main focuses of this patch:
- create grep prioritized actions
- move all option handling and data to a separate module
- restructure grep actions and recursion
and collapse exit points.
Prerequisites:
- This patch assumes that lib/posix/regex.h and src/search.c
have already been fixed using "grep-2.5.1-oi.patch"
available from RedHat
http://cvs.fedora.redhat.com/viewcvs/devel/grep/
(why isn't it available in patches section?)
Otherwise, incorrect (output) results can result from the
new prline implementation in some cases.
Side effects:
- there are currently small aestetic changes in the patch
which has been asked to be left out. Will revert.
- there is currently an alternative improvement for prline
in the patch, which partly overlaps with patch #3770.
This change has been modified to merge improvements in
both patches. Inclusion of this change is still under
discussion.
Output:
After applying this patch, your grep.c will look really
much better. It will be sensibly shorter and clearer.
The recursion will be much more understandable (still
there can be much more improvement), and options won't
haunt the reader, because of the nice separation.
Also the drastic separation between option processing
phase and grep actions helps readability now, and should
make future new features easier to implement.
Additional help wanted:
- Please help me understand the code fragment that (after
patch) results in grep.c:grep_stdin() in the if (1) block.
Claudio
|