Skip to content

Commit

Permalink
Merge pull request #15881 from knutwannheden/15878-fix
Browse files Browse the repository at this point in the history
Quote File.separator when using it as a regular expression
  • Loading branch information
geoand authored Mar 19, 2021
2 parents 0486ec9 + 08181cf commit 15d6212
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ private String commonPath(List<String> paths) {
String commonPath = "";
List<String[]> dirs = new ArrayList<>(paths.size());
for (int i = 0; i < paths.size(); i++) {
dirs.add(i, paths.get(i).split(File.separator));
dirs.add(i, paths.get(i).split(Pattern.quote(File.separator)));
}
for (int j = 0; j < dirs.get(0).length; j++) {
String thisDir = dirs.get(0)[j]; // grab the next directory name in the first path
Expand Down

0 comments on commit 15d6212

Please sign in to comment.