Ticket #372: usermenu_regex.patch

File usermenu_regex.patch, 1.1 KB (added by iNode, 15 years ago)

enable regex matching in user menu on shell_patterns=0

  • user.c

    old new  
    402402{ 
    403403    WPanel *panel; 
    404404    char arg [256]; 
     405    mc_search_type_t search_type; 
     406 
     407    if (easy_patterns) 
     408        search_type = MC_SEARCH_T_GLOB; 
     409    else 
     410        search_type = MC_SEARCH_T_REGEX; 
    405411 
    406412    /* Handle one condition */ 
    407413    for (;*p != '\n' && *p != '&' && *p != '|'; p++){ 
     
    426432            break; 
    427433        case 'f': /* file name pattern */ 
    428434            p = extract_arg (p, arg, sizeof (arg)); 
    429             *condition = panel && mc_search (arg, panel->dir.list [panel->selected].fname, MC_SEARCH_T_GLOB); 
     435            *condition = panel && mc_search (arg, panel->dir.list [panel->selected].fname, search_type); 
    430436            break; 
    431437        case 'y': /* syntax pattern */ 
    432438            if (edit_widget && edit_widget->syntax_type) { 
     
    437443            break; 
    438444        case 'd': 
    439445            p = extract_arg (p, arg, sizeof (arg)); 
    440             *condition = panel && mc_search (arg, panel->cwd, MC_SEARCH_T_GLOB); 
     446            *condition = panel && mc_search (arg, panel->cwd, search_type); 
    441447            break; 
    442448        case 't': 
    443449            p = extract_arg (p, arg, sizeof (arg));