patchgrep - Patches: patch #6735, Fexecute: Remove the last...

 
 
Show feedback again

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

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

Submitted by:  Stepan Kasal <kasal>
Submitted on:  Thu 29 Jan 2009 02:57:07 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

Sun 01 Feb 2009 05:51:07 AM UTC, comment #1:

I think that there is no problem even if the last iteration is removed, but I don't seem a real trigger of bug #479152 exists there. When we give pattern `1' and text `fail' in LC_ALL=ko_KR.eucKR, kwsexec should return not 0 but -1.

(file #17369)

Norihirio Tanaka <noritnk>
Thu 29 Jan 2009 02:57:07 PM UTC, original submission:

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 removed.

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:
https://bugzilla.redhat.com/show_bug.cgi?id=479152
The bug does not reproduce with vanilla GNU grep, but IMHO it would be a good idea to commit this patch anyway.

Stepan Kasal <kasal>
Project Member

 

Attached Files
file #17369:  grep-2.5.3-3.pr479152.patch added by noritnk (468B - application/octet-stream)
file #17350:  grep-Fexecute-for.patch added by kasal (624B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by noritnk (Updated the item)
  • -unavailable- added by kasal (Submitted the item)
  •  

    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 421 here (basic anti-spam test):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 01 Feb 2009 05:51:07 AM UTCnoritnkAttached File-=>Added grep-2.5.3-3.pr479152.patch, #17369
    Thu 29 Jan 2009 02:57:08 PM UTCkasalAttached File-=>Added grep-Fexecute-for.patch, #17350
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup