diff --git a/pom.xml b/pom.xml
index 0e835e6..d19561f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
4.0.0
komposten.vivaldi
VivaldiModder
- 1.0.0
+ 1.0.1
jar
diff --git a/src/main/java/komposten/vivaldi/ui/EditInstructionDialog.java b/src/main/java/komposten/vivaldi/ui/EditInstructionDialog.java
index 8f4b157..8333fa0 100644
--- a/src/main/java/komposten/vivaldi/ui/EditInstructionDialog.java
+++ b/src/main/java/komposten/vivaldi/ui/EditInstructionDialog.java
@@ -304,6 +304,9 @@ private void setRelativePath(BrowseTextField browseField, File file, File relati
if (isFileInDirectory(file, relativeTo, true))
{
path = path.replace(relativeTo.getAbsolutePath(), "");
+
+ if (path.startsWith("/") || path.startsWith("\\"))
+ path = path.substring(1);
}
browseField.getTextfield().setText(path.replace('\\', '/'));
diff --git a/src/main/java/komposten/vivaldi/ui/ModPanel.java b/src/main/java/komposten/vivaldi/ui/ModPanel.java
index 26bdaad..cf9e330 100644
--- a/src/main/java/komposten/vivaldi/ui/ModPanel.java
+++ b/src/main/java/komposten/vivaldi/ui/ModPanel.java
@@ -295,7 +295,7 @@ private void addInstructions(File directory, File relativeTo, File modDir,
if (child.isFile())
{
String modFile = modDir.toPath().relativize(child.toPath()).toString();
- String target = relativeTo.toPath().relativize(child.toPath()).toString();
+ String target = relativeTo.toPath().relativize(directory.toPath()).toString();
if (!onlyFolderContent)
target = DirectoryUtils.assemblePath(targetDir, relativeTo.getName(), target);
diff --git a/src/main/java/komposten/vivaldi/util/DirectoryUtils.java b/src/main/java/komposten/vivaldi/util/DirectoryUtils.java
index 9fa8d3a..2aac848 100644
--- a/src/main/java/komposten/vivaldi/util/DirectoryUtils.java
+++ b/src/main/java/komposten/vivaldi/util/DirectoryUtils.java
@@ -19,6 +19,7 @@
package komposten.vivaldi.util;
import java.io.File;
+import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
@@ -126,7 +127,12 @@ public static String assemblePath(String... elements)
for (int i = 0; i < elements.length; i++)
{
String element = elements[i];
- if (i == 0 || !(elements[i-1].endsWith("/") || elements[i-1].endsWith("\\")))
+
+ if (element.isEmpty())
+ {
+ continue;
+ }
+ else if (i == 0 || !(elements[i-1].endsWith("/") || elements[i-1].endsWith("\\")))
{
if (element.startsWith("/") || element.startsWith("\\"))
builder.append(element);