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

 
 

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

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

Submitter:  Stepan Kasal <kasal>
Submitted:  Thu 29 Jan 2009 02:57:07 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Invalid Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Mon 08 Mar 2010 05:10:30 PM UTC, comment #2: 

Does not apply at all to GNU grep.

Paolo Bonzini <bonzini>
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>
Group Member

 

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

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
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by noritnk (Updated the item)
  • -email is unavailable- added by kasal (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-08 bonzini StatusNone Invalid
        Open/ClosedOpen Closed
    2009-02-01 noritnk Attached File- Added grep-2.5.3-3.pr479152.patch, #17369
    2009-01-29 kasal Attached File- Added grep-Fexecute-for.patch, #17350

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code