@@ -795,6 +795,26 @@ int is_excluded_from_list(const char *pathname,
795
795
return -1 ; /* undecided */
796
796
}
797
797
798
+ static struct exclude * last_exclude_matching_from_lists (struct dir_struct * dir ,
799
+ const char * pathname , int pathlen , const char * basename ,
800
+ int * dtype_p )
801
+ {
802
+ int i , j ;
803
+ struct exclude_list_group * group ;
804
+ struct exclude * exclude ;
805
+ for (i = EXC_CMDL ; i <= EXC_FILE ; i ++ ) {
806
+ group = & dir -> exclude_list_group [i ];
807
+ for (j = group -> nr - 1 ; j >= 0 ; j -- ) {
808
+ exclude = last_exclude_matching_from_list (
809
+ pathname , pathlen , basename , dtype_p ,
810
+ & group -> el [j ]);
811
+ if (exclude )
812
+ return exclude ;
813
+ }
814
+ }
815
+ return NULL ;
816
+ }
817
+
798
818
/*
799
819
* Loads the exclude lists for the directory containing pathname, then
800
820
* scans all exclude lists to determine whether pathname is excluded.
@@ -806,25 +826,13 @@ static struct exclude *last_exclude_matching(struct dir_struct *dir,
806
826
int * dtype_p )
807
827
{
808
828
int pathlen = strlen (pathname );
809
- int i , j ;
810
- struct exclude_list_group * group ;
811
- struct exclude * exclude ;
812
829
const char * basename = strrchr (pathname , '/' );
813
830
basename = (basename ) ? basename + 1 : pathname ;
814
831
815
832
prep_exclude (dir , pathname , basename - pathname );
816
833
817
- for (i = EXC_CMDL ; i <= EXC_FILE ; i ++ ) {
818
- group = & dir -> exclude_list_group [i ];
819
- for (j = group -> nr - 1 ; j >= 0 ; j -- ) {
820
- exclude = last_exclude_matching_from_list (
821
- pathname , pathlen , basename , dtype_p ,
822
- & group -> el [j ]);
823
- if (exclude )
824
- return exclude ;
825
- }
826
- }
827
- return NULL ;
834
+ return last_exclude_matching_from_lists (dir , pathname , pathlen ,
835
+ basename , dtype_p );
828
836
}
829
837
830
838
/*
0 commit comments