Skip to content

Commit f3da02c

Browse files
committed
Allow double quotes in an environment variable
This came up at CRAN on some platforms by BDR using R_KNITR_OPTIONS='knitr.chunk.optipng="-quiet"'
1 parent 4ac920e commit f3da02c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-04-08 Dirk Eddelbuettel <[email protected]>
2+
3+
* src/tools/RInsideEnvVars.r: Allow double quotes in env.var
4+
15
2025-03-19 Dirk Eddelbuettel <[email protected]>
26

37
* inst/examples/sandboxed_server/example_server.cpp: Remove obsolete

src/tools/RInsideEnvVars.r

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ cat(" const char *R_VARS[] = {\n")
1414
for (i in 1:length(IncludeVars)){
1515
if (names(IncludeVars)[i] %in% ExcludeVars)
1616
next
17-
cat(' "',names(IncludeVars)[i],'","',IncludeVars[i],'",\n',sep='')
17+
cat(' "', names(IncludeVars)[i], '", "',
18+
gsub('"', r"(\\")", IncludeVars[i], perl=TRUE),
19+
'",\n', sep='')
1820
}
1921
cat(" NULL\n };\n")

0 commit comments

Comments
 (0)