From 430270c683b2d580ab0395ce1cd2664da40f3ec1 Mon Sep 17 00:00:00 2001
From: Mick Jordan <mick.jordan@oracle.com>
Date: Fri, 2 Sep 2016 15:19:41 -0700
Subject: [PATCH] ContextSystemFunctionFactory: fix bug choosing R/Sscript with
 full quoted path

---
 .../builtin/base/system/ContextSystemFunctionFactory.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/system/ContextSystemFunctionFactory.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/system/ContextSystemFunctionFactory.java
index deadd57df8..04e10d09b6 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/system/ContextSystemFunctionFactory.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/system/ContextSystemFunctionFactory.java
@@ -103,7 +103,12 @@ public class ContextSystemFunctionFactory extends SystemFunctionFactory {
     private static String[] checkRCommand(String command) {
         String[] parts = command.split(" ");
         String rcommand = isFastR(parts[0]);
-        return rcommand == null ? null : parts;
+        if (rcommand == null) {
+            return null;
+        } else {
+            parts[0] = rcommand;
+            return parts;
+        }
 
     }
 
-- 
GitLab