Ticket #1495: mc-4.7.0-pre1.search.patch

File mc-4.7.0-pre1.search.patch, 1.7 KB (added by dborca, 15 years ago)
  • src/search/normal.c

    diff -Naur mc-4.7.0-pre1~/src/search/normal.c mc-4.7.0-pre1/src/search/normal.c
    old new  
    9191        mc_search__normal_translate_to_regex (mc_search_cond->str->str, &mc_search_cond->len); 
    9292 
    9393    g_string_free (mc_search_cond->str, TRUE); 
     94 
     95    if (mc_search->whole_words) { 
     96        g_string_prepend (tmp, "\\b"); 
     97        g_string_append (tmp, "\\b"); 
     98    } 
    9499    mc_search_cond->str = tmp; 
    95100 
    96101    mc_search__cond_struct_new_init_regex (charset, mc_search, mc_search_cond); 
  • src/search/regex.c

    diff -Naur mc-4.7.0-pre1~/src/search/regex.c mc-4.7.0-pre1/src/search/regex.c
    old new  
    6363    const char *special_chars[] = { 
    6464        "\\s", "\\S", 
    6565        "\\d", "\\D", 
    66         "\\B", "\\B", 
     66        "\\b", "\\B", 
    6767        "\\w", "\\W", 
    6868        "\\t", "\\n", 
    6969        "\\r", "\\f", 
  • src/search/search.h

    diff -Naur mc-4.7.0-pre1~/src/search/search.h mc-4.7.0-pre1/src/search/search.h
    old new  
    6363    /* search entire string (from begin to end). Used only with GLOB search type */ 
    6464    gboolean is_entire_line; 
    6565 
     66    /* search entire string (from begin to end). Used only with NORMAL search type */ 
     67    gboolean whole_words; 
     68 
    6669    /* function, used for getting data. NULL if not used */ 
    6770    mc_search_fn search_fn; 
    6871