From 8814c74356107e2494ebaf241cf99b9449e44b57 Mon Sep 17 00:00:00 2001 From: David Walluck Date: Mon, 15 Apr 2024 09:43:19 -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;