From 3e5d2fea5503814d66cc6f9b08c1ad014c2f0ec1 Mon Sep 17 00:00:00 2001 From: stepan <stepan.sindelar@oracle.com> Date: Wed, 7 Mar 2018 16:53:44 +0100 Subject: [PATCH] RDeparse make sure file separator is not used in filename --- .../src/com/oracle/truffle/r/runtime/RDeparse.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java index e8738cd70b..7bef648d8b 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RDeparse.java @@ -15,6 +15,7 @@ import static java.nio.file.StandardOpenOption.CREATE_NEW; import static java.nio.file.StandardOpenOption.WRITE; import java.io.BufferedWriter; +import java.io.File; import java.io.IOException; import java.nio.file.AccessDeniedException; import java.nio.file.FileAlreadyExistsException; @@ -368,7 +369,7 @@ public class RDeparse { // just use the first 10 hex digits to have a nicer file name if (qualifiedFunctionName != null && !qualifiedFunctionName.isEmpty() && !qualifiedFunctionName.equals("<no source>")) { - path = tmpDir.resolve(qualifiedFunctionName + "-" + printHexBinary.substring(0, 10) + ".r"); + path = tmpDir.resolve(qualifiedFunctionName.replace(File.separatorChar, '_') + "-" + printHexBinary.substring(0, 10) + ".r"); } else { path = tmpDir.resolve(printHexBinary.substring(0, 10) + ".r"); } -- GitLab