time | calls | line |
---|
| | 85 | function f = refinePath(f, fs)
|
| 11 | 86 | persistent singleDotPattern multipleFileSepPattern
|
| | 87 |
|
| 11 | 88 | if isempty(singleDotPattern)
|
| | 89 | singleDotPattern = [fs, '.', fs];
|
| | 90 | multipleFileSepPattern = [fs, fs];
|
| | 91 | end
|
| | 92 |
|
| 11 | 93 | f = strrep(f, '/', fs);
|
| | 94 |
|
| 11 | 95 | if iscell(f)
|
| | 96 | hasSingleDotCell = ~cellfun('isempty',strfind(f, singleDotPattern));
|
| | 97 | if any(hasSingleDotCell)
|
| | 98 | f(hasSingleDotCell) = replaceSingleDots(f(hasSingleDotCell), fs);
|
| | 99 | end
|
| | 100 |
|
| | 101 | hasMultipleFileSepCell = ~cellfun('isempty',strfind(f, multipleFileSepPattern));
|
| | 102 | if any(hasMultipleFileSepCell)
|
| | 103 | f(hasMultipleFileSepCell) = replaceMultipleFileSeps(f(hasMultipleFileSepCell), fs);
|
| | 104 | end
|
| 11 | 105 | else
|
| 11 | 106 | if ~isempty(strfind(f, singleDotPattern))
|
| | 107 | f = replaceSingleDots(f, fs);
|
| | 108 | end
|
| | 109 |
|
| 11 | 110 | if ~isempty(strfind(f, multipleFileSepPattern))
|
| | 111 | f = replaceMultipleFileSeps(f, fs);
|
| | 112 | end
|
| 11 | 113 | end
|
| 11 | 114 | end
|
Other subfunctions in this file are not included in this listing.