patchgrep - Patches: patch #3797, grep restructure patch

 
 

You are not allowed to post comments on this tracker with your current authentification level.

patch #3797: grep restructure patch

Submitted by:  Claudio Fontana <sick_soul>
Submitted on:  Mon 07 Mar 2005 01:41:07 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: Need InfoPrivacy: Public
Assigned to: NoneOpen/Closed: Open

Mon 08 Mar 2010 05:12:14 PM UTC, comment #3:

Claudio, thanks for your work!

Would you like to take up this patch again and bring it up to date? We'd love to see more refactoring in grep.c.

Paolo Bonzini <bonzini>
Mon 07 Mar 2005 01:58:29 PM UTC, comment #2:

fix: remove changes to lib/posix/regex.h

Claudio Fontana <sick_soul>
Mon 07 Mar 2005 01:51:37 PM UTC, comment #1:

The revise

Claudio Fontana <sick_soul>
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

Claudio Fontana <sick_soul>

 

Attached Files
file #8559:  grep-restructure-stripped.3.patch added by sick_soul (82kB - text/x-patch - removed check for ':' as separator. Why should we lose generalization?)
file #8542:  grep-restructure-stripped.1.patch added by sick_soul (82kB - text/x-patch - a stripped version of the restructure patch. Other changes in search.c will be made available separately.)

 

Digest:
   patch dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bonzini (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 08 Mar 2010 05:12:31 PM UTCbonziniStatusNone=>Need Info
    Tue 12 Apr 2005 03:13:02 PM UTCjulianfoadDependencies-=>Depends on patch #3807
    Sun 13 Mar 2005 02:57:20 AM UTCsick_soulAttached File-=>Added grep-restructure-stripped.3.patch, #4330
    Mon 07 Mar 2005 01:58:29 PM UTCsick_soulAttached File-=>Added grep-restructure-stripped.2.patch, #4304
    Mon 07 Mar 2005 01:51:37 PM UTCsick_soulAttached File-=>Added grep-restructure-stripped.1.patch, #4303

    Back to the top


    Powered by Savane 3.1-cleanup