From d9aac6b90b1cfbaa619b150513bc4388606a9204 Mon Sep 17 00:00:00 2001 From: David Walluck Date: Mon, 15 Apr 2024 17:36:55 -0400 Subject: [PATCH] Normalize paths when adding intermediate directories --- .../rpm/builder/MissingDirectoryGeneratorInterceptor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/dentrassi/rpm/builder/MissingDirectoryGeneratorInterceptor.java b/src/main/java/de/dentrassi/rpm/builder/MissingDirectoryGeneratorInterceptor.java index 867d7bc..0d039b9 100644 --- a/src/main/java/de/dentrassi/rpm/builder/MissingDirectoryGeneratorInterceptor.java +++ b/src/main/java/de/dentrassi/rpm/builder/MissingDirectoryGeneratorInterceptor.java @@ -10,6 +10,7 @@ *******************************************************************************/ package de.dentrassi.rpm.builder; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; @@ -131,7 +132,7 @@ private List getIntermediateDirectories(String targetName) { for (int i = 1; i < path.getNameCount(); i++) { Path subPath = path.subpath(0, i); - intermediateDirectories.add("/" + subPath); + intermediateDirectories.add("/" + subPath.toString().replace(File.separatorChar, '/')); } return intermediateDirectories;