Skip to content

Commit b5e0a3d

Browse files
committed
Cleaning of Path
1 parent 600a987 commit b5e0a3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/flightgear/terramaster/HTTPTerraSync.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private int syncDirectory(String path, boolean force, TerraSyncDirectoryTypes ty
374374
if (cancelFlag)
375375
return updates;
376376
HashMap<String, String> parentTypeLookup = buildTypeLookup(getRemoteDirIndex(baseUrl, getParent(path)));
377-
String[] parts = path.replace("\\", "/").split("/");
377+
String[] parts = path.replace("\\", "/").replace("//", "/").split("/");
378378
String string = parts[parts.length - 1];
379379
String pathType = parentTypeLookup.get(string);
380380

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

0 commit comments

Comments
 (0)