[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #6735] Fexecute: Remove the last iteration fo for(), over empty s

From: Stepan Kasal
Subject: [patch #6735] Fexecute: Remove the last iteration fo for(), over empty string
Date: Thu, 29 Jan 2009 14:57:10 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2) Gecko/20090107 Fedora/3.1-0.4.beta2.fc11 Minefield/3.1b2


                 Summary: Fexecute: Remove the last iteration fo for(), over
empty string
                 Project: grep
            Submitted by: kasal
            Submitted on: Thu 29 Jan 2009 03:57:07 PM CET
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any



In Fexecute, kwsexec is called in a for loop, where the start position
iterates from the beginning to the end.
In the last iteration, the start position is the end of the string, so
kwsexec is called on an empty string. I do not see any reason why this is done
and I think that fgrep would still work correctly if this last iteration were

AFAIK, the current code also works correctly, but I believe the patch make
the code more elegant and more understandable.

This is what the patch does.  OK to commit?

More info:
This patch was needed in Fedora's patched version of grep to fix the
following bug:
The bug does not reproduce with vanilla GNU grep, but IMHO it would be a good
idea to commit this patch anyway.


File Attachments:

Date: Thu 29 Jan 2009 03:57:08 PM CET  Name: grep-Fexecute-for.patch  Size:
624B   By: kasal



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]