patchgrep - Patches: patch #3797, grep restructure patch


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

patch #3797: grep restructure patch

Submitter:  Claudio Fontana <sick_soul>
Submitted:  Mon 07 Mar 2005 01:41:07 PM UTC
Category:  None Priority:  5 - Normal
Status:  Need Info Privacy:  Public
Assigned to:  None Open/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.


- 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

  (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


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


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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


Depends on the following items

   patch dependencies.

Items that depend on this one: None found


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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-08 bonzini StatusNone Need Info
    2005-04-12 julianfoad Dependencies- Depends on patch #3807
    2005-03-13 sick_soul Attached File- Added grep-restructure-stripped.3.patch, #4330
    2005-03-07 sick_soul Attached File- Added grep-restructure-stripped.2.patch, #4304
    2005-03-07 sick_soul Attached File- Added grep-restructure-stripped.1.patch, #4303

    Back to the top

    Powered by Savane 3.13-3736.
    Corresponding source code