Permalink
Browse files

MRG: resolve merge conflict

  • Loading branch information...
2 parents 0349d67 + fbbd34d commit 70afe1429619b9d91c9b047f781a73f342d78788 @nno nno committed Jul 27, 2016
Showing with 10 additions and 14 deletions.
  1. +10 −14 MOcov/mocov_find_files.m
View
@@ -46,10 +46,7 @@
exclude_pat={exclude_pat};
end
- file_re=['^' ... % start of the string
- regexptranslate('wildcard',file_pat) ...
- '$']; % end of the string
-
+ file_re=pattern2re(file_pat);
exclude_re=get_exclude_re(exclude_pat);
if ~isempty(monitor)
@@ -58,6 +55,12 @@
end
res=find_files_recursively(root_dir,file_re,monitor,exclude_re);
+
+
+function re=pattern2re(pat)
+ re=['^' ... % start of the string
+ regexptranslate('wildcard',pat) ...
+ '$']; % end of the string
function re=get_exclude_re(exclude_pat)
n=numel(exclude_pat);
@@ -66,20 +69,13 @@
return;
end
- excl_re_cell=cell(n,1);
- for k=1:n
- re_k=['^' ... % start of the string
- regexptranslate('wildcard',exclude_pat{k}) ...
- '$']; % end of the string
- excl_re_cell{k}=re_k;
- end
-
+ excl_re_cell=cellfun(@pattern2re,exclude_pat,...
+ 'UniformOutput',false);
+
joined=sprintf('|%s',excl_re_cell{:});
re=joined(2:end);
-
-
function res=find_files_recursively(root_dir,file_re,monitor,exclude_re)
if isempty(root_dir)
dir_arg={};

0 comments on commit 70afe14

Please sign in to comment.