Ticket #264 (closed defect: duplicate)

Opened 15 years ago

Last modified 15 years ago

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

searchbug.txt (116 bytes) - added by egmont 15 years ago.
Test case
search.patch (372 bytes) - added by egmont 15 years ago.
The fix

Change History

Changed 15 years ago by egmont

Test case

Changed 15 years ago by egmont

The fix

comment:1 in reply to: ↑ description Changed 15 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 15 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 15 years ago by slavazanko

relative to #265. As fact, this one problem, but different shows. :)

comment:4 Changed 15 years ago by slavazanko

  • Owner set to slavazanko
  • Status changed from new to accepted

comment:5 Changed 15 years ago by styx

  • Status changed from accepted to testing
  • Resolution set to duplicate

comment:6 Changed 15 years ago by styx

  • Status changed from testing to closed

All the development goes to #265

Note: See TracTickets for help on using tickets.