Skip to content
Snippets Groups Projects
Commit fa6b82c5 authored by Mick Jordan's avatar Mick Jordan
Browse files

remove quotes on default values in Renviron files

parent ff85f0be
No related branches found
No related tags found
No related merge requests found
......@@ -220,7 +220,6 @@ public final class REnvVars implements RContext.ContextState {
}
String var = line.substring(0, ix);
String value = expandParameters(line.substring(ix + 1)).trim();
// GnuR does not seem to remove quotes, although the spec says it should
envVars.put(var, value);
}
}
......@@ -243,7 +242,7 @@ public final class REnvVars implements RContext.ContextState {
}
String paramValue = envVars.get(paramName);
if (paramValue == null || paramValue.length() == 0) {
paramValue = paramDefault;
paramValue = stripQuotes(paramDefault);
}
result.append(paramValue);
x = paramEnd + 1;
......@@ -253,6 +252,17 @@ public final class REnvVars implements RContext.ContextState {
return result.toString();
}
private static String stripQuotes(String s) {
if (s.length() == 0) {
return s;
}
if (s.charAt(0) == '\'') {
return s.substring(1, s.length() - 1);
} else {
return s;
}
}
@TruffleBoundary
private static IOException invalid(String path, String line) throws IOException {
throw new IOException(" File " + path + " contains invalid line(s)\n " + line + "\n They were ignored\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment