Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update develop from main #1594

Merged
merged 6 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading