Ticket #264 (closed defect: duplicate)
Search bug with manpages bold/underlined text
Reported by: | egmont | Owned by: | slavazanko |
---|---|---|---|
Priority: | minor | Milestone: | 4.7 |
Component: | mc-core | Version: | 4.6.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: |
Description
Occasionally when you do a simple search (F7) in mc's built-in viewer while viewing a manual page, it doesn't find some yellow or red ("bold" or "underlined") text.
Patch attached to fix the problem.
Example test case: See the attached file that contains "abababc" in bold (that is, each letter followed by a backspace, then the same letter again). Search for "ababc" and it won't match that string, though it should.
Explanation (line numbers according to 4.6.2):
In src/util.c: _icase_search() line 812-815 you increase "e" (the haystack pointer) and "dlng" (counitng characters that were skipped because of a backspace) every time you skip a character and the subsequent backspace in the haystack. Later, in line 819, if the partial match turns out not to be a complete one, you rewind the haystack pointer by the number of chars matched from the needle ("d - text"). This, however, forgets about the forward steps that were taken in haystack because of the backspaces. So next time the substring match starts from the wrong position.
Attachments
Change History
Changed 16 years ago by egmont
- Attachment searchbug.txt added
comment:1 in reply to: ↑ description Changed 16 years ago by egmont
(Note that unlike many of my reports, this one has nothing to do with utf-8. It's a bug in mainstream mc.)
comment:2 Changed 16 years ago by styx
Patch can't be applied for current time. We now have new search engine. Bug has a new incarnation. Test case is same, but behavior is different (see it your self).
comment:3 Changed 16 years ago by slavazanko
relative to #265. As fact, this one problem, but different shows. :)
comment:4 Changed 16 years ago by slavazanko
- Status changed from new to accepted
- Owner set to slavazanko
Test case