Changeset 41c9a96 for functions.c


Ignore:
Timestamp:
Jul 24, 2009, 12:59:23 AM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
64c9165
Parents:
ab225e0
git-author:
Anders Kaseorg <andersk@mit.edu> (07/24/09 00:51:10)
git-committer:
Anders Kaseorg <andersk@mit.edu> (07/24/09 00:59:23)
Message:
Reimplement search in terms of owl_regex.

The current implementation of stristr has problems and there isn’t a
good replacement available.  This was its only caller, so we can get
rid of it now.

Also, this will make it possible to search with arbitrary regexes if
someone feels like coming up with a syntax.

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

Legend:

Unmodified
Added
Removed
  • functions.c

    rab225e0 r41c9a96  
    29672967  /* direction is OWL_DIRECTION_DOWNWARDS or OWL_DIRECTION_UPWARDS or
    29682968   * OWL_DIRECTION_NONE */
    2969   owl_global_set_search_string(&g, string);
     2969  owl_regex re;
     2970
     2971  if (string && owl_regex_create_quoted(&re, string) == 0) {
     2972    owl_global_set_search_re(&g, &re);
     2973    owl_regex_free(&re);
     2974  } else {
     2975    owl_global_set_search_re(&g, NULL);
     2976  }
    29702977
    29712978  if (direction == OWL_DIRECTION_NONE)
     
    30203027  for (i=start; i<viewsize && i>=0;) {
    30213028    m=owl_view_get_element(v, i);
    3022     if (owl_message_search(m, owl_global_get_search_string(&g))) {
     3029    if (owl_message_search(m, owl_global_get_search_re(&g))) {
    30233030      owl_global_set_curmsg(&g, i);
    30243031      owl_function_calculate_topmsg(direction);
Note: See TracChangeset for help on using the changeset viewer.