Skip to content

Commit

Permalink
Cleaning of Path
Browse files Browse the repository at this point in the history
  • Loading branch information
Portree-Kid committed Dec 13, 2018
1 parent 600a987 commit b5e0a3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/flightgear/terramaster/HTTPTerraSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ private int syncDirectory(String path, boolean force, TerraSyncDirectoryTypes ty
if (cancelFlag)
return updates;
HashMap<String, String> parentTypeLookup = buildTypeLookup(getRemoteDirIndex(baseUrl, getParent(path)));
String[] parts = path.replace("\\", "/").split("/");
String[] parts = path.replace("\\", "/").replace("//", "/").split("/");
String string = parts[parts.length - 1];
String pathType = parentTypeLookup.get(string);

Expand Down Expand Up @@ -453,6 +453,7 @@ private int processDir(String path, boolean force, TerraSyncDirectoryTypes type)
// otherwise check the SHA against
// the one from the server
String dirname = path + "/" + splitLine[1];
dirname = dirname.replace("\\", "/").replace("//", "/");
if (force || !(new File(dirname).exists()) || !splitLine[2].equals(lookup.get(splitLine[1])))
updates += syncDirectory(dirname, force, type);
} else if (line.startsWith("f:")) {
Expand Down

0 comments on commit b5e0a3d

Please sign in to comment.