diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Globber.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Globber.java index 7c69167c3a125..ceee4f2e10367 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Globber.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Globber.java @@ -254,8 +254,8 @@ private FileStatus[] doGlob() throws IOException { if (!child.isDirectory()) continue; } // Set the child path based on the parent path. - child.setPath(new Path(candidate.getPath(), - child.getPath().getName())); + child.setPath(new Path(candidate.getPath().toString() + Path.SEPARATOR + + child.getPath().getName())); if (globFilter.accept(child.getPath())) { newCandidates.add(child); }