Skip to content

Commit

Permalink
File path comparison are done on the canonical path.
Browse files Browse the repository at this point in the history
  • Loading branch information
briacp committed Jun 17, 2019
1 parent 8309798 commit 3be0186
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

Expand Down Expand Up @@ -98,8 +99,9 @@ public static void writeProjectFile(ProjectProperties props, File outFile) throw
m.marshal(om, outFile);
}

private static String getPathForStoring(String root, String absolutePath, String defaultName) {
if (defaultName != null && new File(absolutePath).equals(new File(root, defaultName))) {
private static String getPathForStoring(String root, String absolutePath, String defaultName) throws IOException {
if (defaultName != null
&& new File(absolutePath).getCanonicalPath().equals(new File(root, defaultName).getCanonicalPath())) {
return org.omegat.util.ProjectFileStorage.DEFAULT_FOLDER_MARKER;
}

Expand Down

0 comments on commit 3be0186

Please sign in to comment.