Skip to content

Commit

Permalink
Merge pull request #1594 from jplag/main
Browse files Browse the repository at this point in the history
Update develop from main
  • Loading branch information
tsaglam authored Feb 21, 2024
2 parents 5d1ce9d + 9786faa commit d079a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/main/java/de/jplag/reporting/FilePathUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

public final class FilePathUtil {
private static final String ZIP_PATH_SEPARATOR = "/"; // Paths in zip files are always separated by a slash
private static final String WINDOWS_PATH_SEPARATOR = "\\";

private FilePathUtil() {
// private constructor to prevent instantiation
Expand Down Expand Up @@ -35,12 +36,12 @@ public static String getRelativeSubmissionPath(File file, Submission submission,
*/
public static String joinZipPathSegments(String left, String right) {
String rightStripped = right;
while (rightStripped.startsWith(ZIP_PATH_SEPARATOR)) {
while (rightStripped.startsWith(ZIP_PATH_SEPARATOR) || rightStripped.startsWith(WINDOWS_PATH_SEPARATOR)) {
rightStripped = rightStripped.substring(1);
}

String leftStripped = left;
while (leftStripped.endsWith(ZIP_PATH_SEPARATOR)) {
while (leftStripped.endsWith(ZIP_PATH_SEPARATOR) || leftStripped.startsWith(WINDOWS_PATH_SEPARATOR)) {
leftStripped = leftStripped.substring(0, leftStripped.length() - 1);
}

Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<module>languages</module>
<module>language-api</module>
<module>language-testutils</module>
<module>language-antlr-utils</module>
</modules>
<build>
<plugins>
Expand Down

0 comments on commit d079a98

Please sign in to comment.