@@ -2938,7 +2938,12 @@ impl Interpreter {
29382938 // Extglob *(pattern-list) — collect remaining pattern
29392939 let remaining_pattern: String = pattern_chars. collect ( ) ;
29402940 let remaining_value: String = value_chars. collect ( ) ;
2941- return self . glob_match_impl ( & remaining_value, & remaining_pattern, nocase, depth + 1 ) ;
2941+ return self . glob_match_impl (
2942+ & remaining_value,
2943+ & remaining_pattern,
2944+ nocase,
2945+ depth + 1 ,
2946+ ) ;
29422947 }
29432948 pattern_chars. next ( ) ;
29442949 // * matches zero or more characters
@@ -2949,7 +2954,12 @@ impl Interpreter {
29492954 while value_chars. peek ( ) . is_some ( ) {
29502955 let remaining_value: String = value_chars. clone ( ) . collect ( ) ;
29512956 let remaining_pattern: String = pattern_chars. clone ( ) . collect ( ) ;
2952- if self . glob_match_impl ( & remaining_value, & remaining_pattern, nocase, depth + 1 ) {
2957+ if self . glob_match_impl (
2958+ & remaining_value,
2959+ & remaining_pattern,
2960+ nocase,
2961+ depth + 1 ,
2962+ ) {
29532963 return true ;
29542964 }
29552965 value_chars. next ( ) ;
@@ -2965,7 +2975,12 @@ impl Interpreter {
29652975 if extglob && pc_clone. peek ( ) == Some ( & '(' ) {
29662976 let remaining_pattern: String = pattern_chars. collect ( ) ;
29672977 let remaining_value: String = value_chars. collect ( ) ;
2968- return self . glob_match_impl ( & remaining_value, & remaining_pattern, nocase, depth + 1 ) ;
2978+ return self . glob_match_impl (
2979+ & remaining_value,
2980+ & remaining_pattern,
2981+ nocase,
2982+ depth + 1 ,
2983+ ) ;
29692984 }
29702985 if value_chars. peek ( ) . is_some ( ) {
29712986 pattern_chars. next ( ) ;
@@ -3132,9 +3147,12 @@ impl Interpreter {
31323147 let prefix = & value[ ..split] ;
31333148 let suffix = & value[ split..] ;
31343149 // prefix must not match any alt
3135- let prefix_matches_any =
3136- alts. iter ( ) . any ( |a| self . glob_match_impl ( prefix, a, nocase, depth + 1 ) ) ;
3137- if !prefix_matches_any && self . glob_match_impl ( suffix, rest, nocase, depth + 1 ) {
3150+ let prefix_matches_any = alts
3151+ . iter ( )
3152+ . any ( |a| self . glob_match_impl ( prefix, a, nocase, depth + 1 ) ) ;
3153+ if !prefix_matches_any
3154+ && self . glob_match_impl ( suffix, rest, nocase, depth + 1 )
3155+ {
31383156 return true ;
31393157 }
31403158 }
0 commit comments