Changeset 0ed5c57


Ignore:
Timestamp:
Oct 7, 2009, 12:46:39 AM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5791bf7
Parents:
26cde20
git-author:
Anders Kaseorg <andersk@mit.edu> (10/05/09 19:34:33)
git-committer:
Anders Kaseorg <andersk@mit.edu> (10/07/09 00:46:39)
Message:
Don’t loop infinitely on matching the empty string.

This fixes a hang on
  :perl BarnOwl::search('')
and (due to another bug) on
  :search !!

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    rf119757 r0ed5c57  
    315315        int start, end;
    316316        while (owl_regex_compare(owl_global_get_search_re(&g), s, &start, &end) == 0) {
     317          /* Prevent an infinite loop matching the empty string. */
     318          if (end == 0)
     319            break;
     320
    317321          /* Found search string, highlight it. */
    318322
Note: See TracChangeset for help on using the changeset viewer.